0

I am building landing pages that will be used as direct links, not from a list on a catch all type page. I want to use one template, no categories. I am showing content from two different channels, one for the landing page and one for the "program" area. I am using an embed and {if} statements for the program channel that is nested within the other.

This all seems to be working, although to have the embedded program channel content display, I have to include the folder structure in the url_title field for the entry (so, instead of just putting "caribbean_culture" or "examine_change" in the url_title field, I'm having to put "template_group/template/url_title" or else the embedded channel content won't show up.) And then after it saves, its converted to template_group_template_url_title.

However, I'm not able to have the URL pull the specified entry. Instead, it just pulls the first or the last, depending on how I have the sort set up. So, using this:

{exp:channel:entries channel="landing" disable="member_data|pagination" sort="desc" limit="1"}

I get the same entry for either of these URLs, although they should actually show different entries:

http://www.sea.edu/learn_more/sea_semester_voyages/caribbean_culture http://www.sea.edu/learn_more/sea_semester_voyages/examine_change

If I change the sort to 'asc' in the channel:entries tag, then I do see the other entry, but again, at both URLs. I have the functionality of the single entry displaying on a page working on other templates in the site, but they are fed by an initial link on another page, that uses

href="template/{url_title}"

to build the page.

Is there some parameter to include in the channel:entries tag that uses the url_title to dictate the entry that is on the page that matches the URL? Or some other solution?

I tried "require_entry" to no avail.

3 Answers 3

0

You could use the Pages module to do this, or even template routing if you are using the latest version of EE.

The Pages module is probably simplest for you and will allow you to assign an arbitrary url to any entry you create.

0

Didn't fully understand your question, so i updated this answer. First you pull the right entry from the landing pages channel, close the channel:entries loop, and open another loop for the entries in the other channel. note that you need to use dynamic="no" otherwise the template parser will get confused.

So your landing page will look like this:

<html>
{exp:channel:entries channel="landing" disable="member_data|pagination|categories" sort="desc" limit="1" url_title="{segment_3}" dynamic="no"}
-- your content --
{/exp:channel:entries}
{exp:channel:entries channel="program" disable="member_data|categories" sort="desc" dynamic="no" paginate="bottom"}
-- your content --
{/exp:channel:entries}
</html>

if you need content from the landing channel after the program block, you might want to use an embed/snippet for the program entries.

3
  • Tried this, with no luck. The embedded chunk that uses a channel that is different than the entry channel still isn't show up, when the url_title is part of the url. It will show up when the URL ends with the template, so its not something with the embed code. Commented Sep 8, 2014 at 17:20
  • I'll be totally honest that I was quite confused by the question but have you tried adding dynamic="no" to the Channel Entries tag parameter that is in question here? That will prevent the URL of the page from affecting the output from that tag. Apologies if that's not what you're after but I couldn't quite follow the question I'm afraid.
    – Mark Bowen
    Commented Sep 9, 2014 at 10:19
  • Jelle Dijkstra's answer should do all that is required based on the question. Not sure what the need to use embeds is about - you don't appear to need to use them at all in this case. Perhaps if you can expand the question to clarify what you are actually doing, the answers might be adjusted to better match your requirements. Commented Apr 25, 2017 at 9:37
0

From the sounds of it you are trying to use the URL to drive your entries tag (i.e. dynamic="yes") but its not playing fair. I am afraid I can't help with that in particular as I avoid this URl stuff like the plauge!

Can I ask, have you set up a custom route setting for the section on the site?

Otherwise another solution would be to pass the segment variable straight into your channel entries tag :

{exp:channel:entries dynamic="no" url_title="{segment_3}" channel="landing" disable="member_data|pagination"}
     {!-- do stuff --}
{/exp:channel:entries}

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.