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.

Problems parsing a permalink=...-snippet

October 30, 2012 8:59am

Subscribe [2]
  • #1 / Oct 30, 2012 8:59am

    lehrerfreund

    263 posts

    Hi,
    I have this code to link to my tell-a-friend-page (simplified):

    {exp:channel:entries channel="{tec_my_channel}" limit="1" disable="member_data|trackbacks|pagination" track_views="three" status="open" cache="no" refresh="2500" require_entry="yes"}
        {if no_results OR segment_5!=""}{redirect="technik/404"}{/if}
    
    {if dachzeile != ""}<h4>{dachzeile}</h4><p>{/if}<br />
    <h1>{title}</h1><br />
    {if thumb_bild}{thumb_bild}{/if}</p>
    
    <p>{tec_empfehlen}</p>
    
    <p>...<br />
    {/exp:channel:entries}

    Now the snippet “tec_empfehlen” contains

    <a href="http://{permalink={tec_my_template_group}/tell_friend}">recommend this entry</a>

    But the link is parsed as

    <a href="http://www.lehrerfreund.de/technik/1s/bauteil-in-perspektive-ansichten-finden/{permalink={tec_my_template_group}/tell_friend}">http://www.lehrerfreund.de/technik/1s/bauteil-in-perspektive-ansichten-finden/{permalink={tec_my_template_group}/tell_friend}</a>

    When I take the code of the snippet and put it into the template, everything works correctly.

    I know that there is the parse-order, but in another template (which is quite similar to the one I quoted above) I call a snippet which is also very much similar to the one I quoted above - and there it works.

    Is there any help or idea?
    Thanks in advance!

  • #2 / Oct 30, 2012 10:55am

    I would try doing it withour the permalink:

    just try:

    <a href="http://{site_url}/{tec_my_template_group}/tell_friend">recommend this entry</a>
  • #3 / Oct 30, 2012 10:59am

    lehrerfreund

    263 posts

    Thanks, but it’s a similar problem - the link is not correctly parsed, output is like

    <a href="http://www.lehrerfreund.de//{tec_my_template_group}/tell_friend">http://www.lehrerfreund.de//{tec_my_template_group}/tell_friend</a>
  • #4 / Oct 30, 2012 11:02am

    Doesn’t look like a problem related to the parsing order.

    Just looks like EE doesn’t recognize your variable “{tec_my_template_group}”

    Where did you define {tec_my_template_group} ?

  • #5 / Oct 30, 2012 11:05am

    lehrerfreund

    263 posts

    It’s a snippet, and it works throughout the site. If I use another snippet (which works in another context perfectly), it’s the same problem.

  • #6 / Oct 30, 2012 11:06am

    does it work outside your embed ?

  • #7 / Oct 30, 2012 11:10am

    lehrerfreund

    263 posts

    Yes, outside it works. Even if I paste the whole code of the snippet “tec_empfehlen” just into the template instead of using the snippet, it works.

  • #8 / Oct 31, 2012 7:58pm

    lehrerfreund

    263 posts

    Shane told me (in context of another issue), that I can’t use snippets inside of snippets.

    It seems this sometimes works, and sometimes not. But probably you MUST NOT use snippets inside of snippets.
    So I found another solution and now it works.

    Thanks to all and my case closed 😊

  • #9 / Oct 31, 2012 11:07pm

    Kevin Smith

    4784 posts

    Glad to hear you found a solution, lehrerfreund!

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

ExpressionEngine News!

#eecms, #events, #releases