tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/86-format-issues-system-data-structure-all-displaying-the-first-item-in-content-indexCascade CMS: Discussion 2018-10-18T20:36:27Ztag:help-archives.hannonhill.com,2010-02-09:Comment/129459132012-01-16T19:36:17Z2012-01-16T19:36:17ZFormat issues: system-data-structure - all displaying the first item in content index<div><p>Hey Lauren --</p>
<p>Your issue stems from referencing your <code>$docs</code>
variable inside your loop. You'll want to use <code>$doc</code> in
your XPath statements. <code>$doc</code> is your reference to each
<code>system-page</code> as you loop through, while
<code>$docs</code> is a reference to the list as a whole.</p>
<p>A few things I want to also introduce you to:</p>
<p>I find it easier to use this notation for eliminating my base
assets:<br>
<code>/system-index-block/system-page[not(contains(path,'base-asset'))]</code><br>
The reason is because I can just update what string I am looking
for inside the node. It can appear anywhere in the value of that
node. I personally just find it easier to look for the presence of
a particular string rather than trying to match the entire
thing.</p>
<p>I also noticed that some of your <code>system-page</code> nodes
are actually missing values for <code>nameFirst</code> and
<code>nameLast</code>. If those fields aren't going to be required,
you might want to eliminate those from your loop as well on your
initial XPath query:<br>
<code>[system-data-structure/name/nameFirst!=''][system-data-structure/name/nameLast!='']</code></p>
<p>Hope all this info helps! Let me know if you need anything
else.</p></div>Charlie Holdertag:help-archives.hannonhill.com,2010-02-09:Comment/129459132012-01-16T20:31:10Z2012-01-16T20:31:10ZFormat issues: system-data-structure - all displaying the first item in content index<div><p>Charlie,<br>
I should have caught on to that when the path was working, but the
names weren't. Thanks for the quick reply.</p>
<p>The nameFirst and nameLast are required fields, but since we
added them to the data definition after the pages were created, we
had to go back and fill them in. Once I updated these, everything
is working correctly.</p></div>lauren.fraser