I am trying to send the entry_id to an embedded HTML template. {layout="_embeds/_html-layout" entry_id='613' test="test"}
It works when I use a hard-coded entry ID, but it doesn’t work when I use the following. {layout="_embeds/_html-layout" entry_id='[entry_id}’ test=”test”}
What must I do to send the entry ID to the layout template?
Ah OK I’d do it a different way using a layout variable.
So in your channel entries tag use a layout:set tag to set the entry ID value:
{exp:channel:entries channel="yourchannel" ...}
<!-- get the entry ID and set the layout:set tag with name 'the_id'-->
{layout:set name="the_id"}{entry_id}{/layout:set}
<!-- entry fields-->
<h1>{title}</h1>
...etc
{/exp:channel:entries}The layout:set tag essentially passes its value to the layout template to use as you need.
Then, assuming your SEO_lite tag is in your layout template, call the layout set value like this:
{exp:seo_lite entry_id="{layout:the_id}"}Does that help?
Sorry it doesn’t.
{layout="_embeds/_html-layout" entry_id="{entry_id}”}
{exp:channel:entries channel="products|projects" status="not closed" limit="1" disable="member_data|category_fields"}
That is the top of my entry template. Notice the layout call is outside the exp:channel:entries tag. If I use that code, the entry_id sent to the layout is blank. If I hard code the number, as in “{layout="_embeds/_html-layout" entry_id="613"}”, it works with that entry id. I need to know how to access the entry_id outside the exp:channel:entries tag.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.