ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Auto-create links to entries from multiple channels

March 01, 2011 10:32am

Subscribe [2]
  • #1 / Mar 01, 2011 10:32am

    Paul_B

    86 posts

    I have a template which contains a playa field and allows the admin to pull entries from several channels in to a kind of showcase.

    I need these showcase entries to then link to the correct template, and each channel has its own set of templates.

    Is there a tag that I don’t know (similar to the auto_path and comment_auto_path tags) about that can use the channel path or search results url to build a link? Otherwise I’m going to have to write a big chunk of conditionals ({if channel_short_name=="x"}...{if:elseif}...) etc… which is fine, but seems long-winded.

    Any tips much appreciated. I am using the structure module too, but all of these entries are lists, not pages, and I don’t think structure has a tag that will do this either.

    Essentially, if I have ‘news’ and ‘views’ channels, I want to be able to do this:

    {exp:channel:entries channel="news|views" limit="1"}
        {playa_field}
            <a href="http://{magic_auto_path}">{title}</a>
        {/playa_field}
    {/exp:channel:entries}
  • #2 / Mar 02, 2011 9:08am

    John Henry Donovan

    12339 posts

    Paul,

    Try {comment_url_title_auto_path}

    This variable is replaced by the URL set in the “Comment Page URL” preference under Admin > Channel Management. The URL Title of the entry will be automatically added.

  • #3 / Mar 02, 2011 9:12am

    Paul_B

    86 posts

    That’s brilliant John, thanks very much - I thought there would be a way to do it!

  • #4 / Mar 02, 2011 3:32pm

    Ingmar

    29245 posts

    Glad to see that helped. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases