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.

Snippet bug?

January 23, 2012 2:46pm

Subscribe [1]
  • #1 / Jan 23, 2012 2:46pm

    blg002

    59 posts

    I have a strange bug where a snippet embedded within another snippet isn’t properly parsing. However this is only the case with a new snippet I just created and not the old one that was just replaced. For example:

    {snippet_url}:

    {if channel_id == 2}
      <a href="http://example.com/{url_title}">http://example.com/{url_title}</a>
    {if:else}
      <a href="http://other.com/{url_title}">http://other.com/{url_title}</a>
    {/if}

    {snippet_old}:

    <a href="http://{snippet_url}">Old Link</a>

    {snippet_new}:

    <a href="http://{snippet_url}">New Link</a>


    {snippet_old} Output:

    <a href="http://example.com/my-url-title">Old Link</a>

    {snippet_new} Output:

    <a href="http://{snippet_url}">New Link</a>


    Thats the gist of what’s happening. I’m frankly confused, although I haven’t tried to much debugging hoping you can point to some known issue. Although I doubt it does the order of creating matter, i.e. creation order was {snippet_old}, {snippet_url}, {snippet_new}?


    EE v2.1.0
    Build: 20100720
    MSM

  • #2 / Jan 24, 2012 6:22pm

    Sean C. Smith

    3818 posts

    Hi blg002,

    Embedding snippets is not possible. If it is working at all for you that is unexpected. If you need to embed you’ll need to do that with a template.

    Is there anything else I can assist you with?

    Sean

  • #3 / Jan 24, 2012 9:52pm

    blg002

    59 posts

    Ah, good to know. Wonder why it’s working with the “old” case. Thats all the help I needed, thanks.

  • #4 / Jan 30, 2012 6:56pm

    Sean C. Smith

    3818 posts

    blg002,

    I’m going to close out this thread, but feel free to post again when you have more questions.

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

ExpressionEngine News!

#eecms, #events, #releases