I don't think that the parse order would make this code below work


Is there a way to make embed tag be parsed first before the {exp:channel:entries} is parsed?

If not, what are alternative ways to this(Snippets can't be used if in this case if I am not mistaken)?

2 Answers 2


Why not do it the other way around, where the template being loaded is what actually contains the complex logic? Then you can embed the rest of the template, passing the entry_id via an embed parameter.

Alternately, write a simple plugin which performs your logic and returns the entry_id, then put your Channel Entries tag inside of that plugin tag pair (related example here).

  • Yeah, after exhausting all options, I simply decided to make it a plugin. Commented Nov 28, 2013 at 23:54

Have you tried adding a parse="inward" to your channel:entries tag?

If that doesn't work, you could possibly use stash to set an entry_id variable as a result of your complex logic, and then use that stash var in your channel:entries tag.

eg (very loosely)

        {exp:stash:set name="my_entry_id" type="snippet"}{value}{/exp:stash:set}    
{exp:channel:entries entry_id="{my_entry_id}"}
  • 1
    I tried using a simple stash set and it didn't work. Commented Nov 28, 2013 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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