0

I'm trying to create a navigation menu inside an embed, I have the following code in my main template:

{exp:structure:entries parent_id="{structure:page:entry_id}"}
  {if channel_short_name == "accordion"}
  {embed="site/template_accordian"}
  {/if}
  {if channel_short_name == "album"}
  {embed="site/template_album"}
  {/if}
{/exp:structure:entries}

This works great, however I then have the following inside template_accordian:

<nav id="primary-nav">
  <ul>
    {exp:structure:entries parent_id="{structure:parent:entry_id}"}
    <li><a href="#{url_title}">{title}</a></li>
    {/exp:structure:entries}
  </ul>
</nav>

{structure:parent:entry_id} doesn't seem to output anything, I'm guessing this is due to parsing order or something but can't work out how to achieve what I want to achieve, any ideas?

  • You shouldn't need an embed when you're using structure. Is there a reason why you need to do this? What are you trying to achieve that using the structure tag isn't letting you? – Mark Busnelli Jr Mar 20 '14 at 14:51
0

I don't know if it will work within that embed because of EE's parsing order. You may need to put it directly in the template.

|improve this answer|||||

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.