Hi,
At the minute I’m using a single entry page to display content from a channel within a template group.
On the template page I’m using the titles of the entries as a navigation list.
For example, I have a channel called “About”. Within about I have created 6 entries (listed below).
Signup
Leasing
Contact
Commercial
Customer Services
Find Us
I’m using the code below to create a navigation list linking to the about template.
<ul>{exp:channel:entries channel="about" dynamic="no" disable="categories|member_data|pagination"}
<li><a href="http://{url_title_path=" class="selected">{title}</a></li>
{/exp:channel:entries}
</ul>
What I would like to do is change the template certain entries use. Take the “Find us” page I’d like to link that to a different template with the “About us” template group.
Could anyone point me in the right direction on how to achieve this?
Thanks.
You could just write different links based on which entry is being output. Like:
<ul>
{exp:channel:entries channel="about" dynamic="no" disable="categories|member_data|pagination"}
{if url_title == "find-us"}
<li><a href="http://{url_title_path=%27about-us/your-different-template%27}" class="selected">{title}</a></li>
{if:else}
<li><a href="http://{url_title_path=%27some-segment/another-segment%27}" class="selected">{title}</a></li>
{/if}
{/exp:channel:entries}
</ul>
There are a lot of ways to output the urls themselves, check the variables available in channel entries: https://docs.expressionengine.com/latest/channel/channel_entries.html#single-variables
(Well the code is being botched in the above example.
1st link: href="{url_title_path='about-us/your-different-template'}"
2nd link: href="{url_title_path='some-segment/another-segment'}"
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.