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.

Live look tag?

June 18, 2012 5:13am

Subscribe [2]
  • #1 / Jun 18, 2012 5:13am

    James.Lex

    11 posts

    Hi!

    I am displaying multiple draft-entries in which basically coming from different channels. Is there a way that I can generate the live-look template link like {live-look-link}? Check the code below and thanks in advance.

    {exp:channel:entries status="draft"}
     <tr>
      <td>{entry_date format="%d.%m.%Y"}</td>
      <td><a href="http://{blive_look/b}">{title}</a></td>
      <td>{channel}</td>
     </tr>    
    {/exp:channel:entries}

    best regards,
    James

  • #2 / Jun 19, 2012 12:18pm

    Dan Decker

    7338 posts

    Hi James,

    I think in this context, you would just need to use the standard path variable to set the template you want to use. No need for a special tag. Check this:

    {exp:channel:entries status="draft"}
     <tr>
      <td>{entry_date format="%d.%m.%Y"}</td>
      <td><a href="http://{path=private/live-look}">{title}</a></td>
      <td>{channel}</td>
     </tr>    
    {/exp:channel:entries}

    In that, you would have a “private” template group and a template named “live-look”.

    Cheers,

  • #3 / Jul 02, 2012 8:11am

    James.Lex

    11 posts

    Thanks Dan!

    Sorry for the late reply..
    But what if I am generating lists from different template groups?

    best regards,
    James

  • #4 / Jul 03, 2012 4:37pm

    Dan Decker

    7338 posts

    Hi James,

    You could build the template group based on a URL segment:

    <a href="http://domain.dev/private/other-template-group">http://domain.dev/private/other-template-group</a>

    And the template would be modified like this:

    {exp:channel:entries status="draft"}
     <tr>
      <td>{entry_date format="%d.%m.%Y"}</td>
      <td><a href="http://{path={segment_2}/live-look}">{title}</a></td>
      <td>{channel}</td>
     </tr>    
    {/exp:channel:entries}

    This would be the index template of the private group. With that, you can look in segment 2 for the template group you want to list.

    What do you think?

    Cheers,

  • #5 / Jul 03, 2012 5:15pm

    James.Lex

    11 posts

    Thanks Dan but the I came to a solution using {channel_url} tag whereas every channel have their own default template groups. By executing channel_url tag, then I were able to get the template group.

    Here is the solution. Just in case someone might need it too.

    {exp:channel:entries status="draft"}
     <tr>
      <td>{entry_date format="%d.%m.%Y"}</td>
      <td><a href="http://{channel_url}/live-look/{url_title}">{title}</a></td>
      <td>{channel}</td>
     </tr>    
    {/exp:channel:entries}

    Best regards

  • #6 / Jul 05, 2012 2:51pm

    Shane Eckert

    7174 posts

    Hey James.Lex,

    I am glad to see that you found a solution. Nice work!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases