BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Linking to single entries from a "most recent" channel entries list
#140 opened by Bryan
Description
Hi, I'm having a little trouble getting an entry list to link to their single entry pages properly.
I have a channel:entries loop that shows a list of the five most recently updated entries across a number of channels. All the entries either have an associated page or are assigned to listing page in construct.
How would I go about creating links that follow the correct node path for each entry?
Sample code:
<h1>Recent Updates</h1>
<ul>
{exp:channel:entries channel="page|listing_page|newsletter|meeting_minutes" limit="5" order_by="edit_date" disable="categories|member_data|pagination"}
<li><a href="{title_permalink}">{title}</a></li>
{/exp:channel:entries}
</ul>
I've tried a number of {construct_route:}
variables in different places but nothing seems to work.
Thank you.
Replies
- TJ Draper
Replied 3/15/2019 8:57 PM
I'm sorry for the delay. I was just going through my issues and see that I've missed this one. My apologies!
The trouble in your sample code is that you're trying to get knowledge about Construct but you're in an ExpressionEngine template tag.
In order to get info about Construct, you'll need to use Construct tags. Perhaps something like this:
<h1>Recent Updates</h1> <ul> {exp:channel:entries channel="page|listing_page|newsletter|meeting_minutes" limit="5" order_by="edit_date" disable="categories|member_data|pagination" } {exp:construct:nodes tree_id="123" node_entry_id="{entry_id}" limit="1"} <li><a href="{construct:node_link}">{title}</a></li> {exp:construct:nodes tree_id="2"} {/exp:channel:entries} </ul>