3

I've got an entry tag here that isn't brining in any results whatsoever:

{exp:channel:entries entry_id="{structure:child_ids_for:43}" fixed_order="{structure:child_ids_for:43}"}
  //Content
{/exp:channel:entries}

However, if I call the structure tag and place it between a pair of <p> tags:

<p>{structure:child_ids_for:43}</p>

The result is: <p>48|44|49|50|51|52|53|54|55</p> so that is definitely working correctly.

If I then copy the piped ID list and swap entry_id="{structure:child_ids_for:43}" for entry_id="48|44|49|50|51|52|53|54|55" everything works as intended.

I'm not sure what the difference between those two code segments are. Can anyone help at all?

Thank you.

4

The {structure:child_ids_for:XX} tag is parsed very late, after plugin tags have parsed. In other words, too late to be used as a tag parameter. The channel:entries tag will receive the unparsed structure tag. You will have to use an embed to get around this:

{embed="your/embed" entry_ids="{exp:structure:child_ids entry_id='43'}"}

And your/embed template:

{exp:channel:entries entry_id="{embed:entry_ids}" fixed_order="{embed:entry_ids}"}
  //Content
{/exp:channel:entries}
3
  • Thanks for the quick response, not sure why I didn't think about using an embed. That said I am still running into the issue. {embed="guidelines/navigation" entry_ids="{structure:child_ids_for:43}"} {exp:channel:entries entry_id="{embed:entry_ids}" fixed_order="{embed:entry_ids}"} Calling the {embed:entry_ids} within the embed works perfectly well as before but still no output. Jul 1 '14 at 12:54
  • 1
    I think because of the way the global var is parsed it might not even get parsed until after the embed. Luckily, there is the undocumented {exp:structure:child_ids} tag that should work since it's not a late-parsed global variable. Check my edited answer. Jul 1 '14 at 16:00
  • Amazing! Thank you so much for your time, that has worked perfectly. Jul 1 '14 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.