Hi,
Probably a very noob error, but i'm having some trouble with getResources.
[[getResources?showHidden=1&parents=13&tpl=myTpl&includeContent=1]]
My Chunk:
<li>[[+idx]] - [[*id]] - [[*pagetitle]]</li>
This outputs (there are two 'children' of page number 13):
<li>1 - 13 - Beoordelingen</li>
<li>2 - 13 - Beoordelingen</li>
The wayfinder plugin:
[[!Wayfinder?ignoreHidden=1&startId=13]]
output:
<ul><li class="first"><a href="nl/overzicht/beoordelingen/redacted1.html" title="redacted1" >redacted1</a></li>
<li class="last"><a href="nl/overzicht/beoordelingen/redaccted2.html" title="redaccted2" >redaccted2</a></li>
</ul>
MY QUESTION:
Why does the inner loop of getResources does show the id twice of the page i'm on, not the two child pages?
I'm having a folder with all hidden content (like blog posts) and the page i'm on is the overview page.
Thanks for helping me out!
-
☆ A M B ☆
- 24,524 Posts
Two issues I see here, one not necessarily critical but a very bad habit, and the other the cause of your problem.
For the problem, you are using resource field tags [[*id]] and [[*pagetitle]]. So this will give you those values for the current page... the page that has the snippet calls on it. You need to use placeholder tags [[+id]] and [[+pagetitle]] tags to get the values that the snippets have for each item they are listing.
The bad habit is how you are using the snippet tags. It is better to use them like this
[[getResources? &showHidden=`1` &parents=`13` &tpl=`myTpl` &includeContent=`1`]]
While the way you have it will work, if there happen to be any spaces in the values then it will break.
Thank you for your awesomely correct answer!
And also thanks for informing me about my bad habit, will quit right now! ;-)