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.

Variables in url_title parameter

August 26, 2011 7:05pm

Subscribe [5]
  • #1 / Aug 26, 2011 7:05pm

    bb6600

    13 posts

    Just updated from v.2.1.3 to v.2.2.2 and noticed that the following code is no longer working, as in not returning any results:

    {exp:channel:entries channel="downloads" dynamic="off" url_title="dl_{segment_3}"}

    If I manually replace the value contained within segment_3, the code works as intended and returns the desired results:

    {exp:channel:entries channel="downloads" dynamic="off" url_title="dl_123"}

    I even tried replacing segment_3 with other variables with no success. It looks like anything in curly braces gets ignored if it’s inside the ‘url_title’ parameter.

    Any ideas?

  • #2 / Aug 27, 2011 12:11am

    Dan Decker

    7338 posts

    bb6600,

    What you are trying to do should still work. Give this a shot:

    {exp:channel:entries channel="downloads" dynamic="off" url_title='dl_{segment_3}'}

    Let us know if you need further assistance.

    Cheers,

  • #3 / Aug 27, 2011 12:16pm

    bb6600

    13 posts

    Nope, still not working.

    I’ve tried replacing {segment_3} with {logged_in_member_id} as that’s essentially what I need:

    {exp:channel:entries channel="downloads" dynamic="off" url_title='dl_{logged_in_member_id}'}

    I’ve also tried replacing it with a global variable that I’ve declared as ‘1’, since I know for a fact there’s an entry in the ‘downloads’ channel that has the ‘url_title’ set to ‘dl_1’.:

    {exp:channel:entries channel="downloads" dynamic="off" url_title='dl_{test_variable}'}

    Nothing works, not with double quotes or single quotes for the value, as Dan suggested.

    I’ve tried adding curly braces variables for the ‘url_title’ parameter in other templates as well and it never works. Could someone please double-check that?

  • #4 / Aug 27, 2011 2:41pm

    Osze

    42 posts

    dynamic=“no”

    I’m not sure if that’s what triggers the problem but anyhow it’s “no” and not “off”.

  • #5 / Aug 27, 2011 3:04pm

    bb6600

    13 posts

    I’ve tried both dynamic=“off” and dynamic=“no” and it makes no difference.

  • #6 / Aug 27, 2011 3:19pm

    Osze

    42 posts

    Is the {channel} tag placed in the head-template or embedded?

    I can’t see anything wrong with the tag you’ve published so the problem must be somewhere else.

  • #7 / Aug 27, 2011 3:34pm

    bb6600

    13 posts

    This is in the main template, no embedding.
    While trying to get to the bottom of this, I’ve created the simplest possible test:

    <!doctype html>
    <head>
    <meta charset="UTF-8">
    </head>
    <body>
    
    {exp:channel:entries channel='downloads' dynamic='no' url_title='dl_{logged_in_member_id}_9'}
    {if no_results}Nothing here!{/if}
    I found something for member_id={logged_in_member_id}! - {url_title}
    {/exp:channel:entries}
    
    <hr >
    
    {exp:channel:entries channel='downloads' dynamic='no' url_title='dl_1_9'}
    {if no_results}Nothing here!{/if}
    I found something for member_id={logged_in_member_id}! - {url_title}
    {/exp:channel:entries}
    
    </body>
    </html>

    This results in:

    Nothing here!
    
    I found something for member_id=1! - dl_1_9

    I have no idea what’s going on.
    Can someone please verify for me that curly braces do indeed work inside ‘url_title’ ?

  • #8 / Aug 28, 2011 2:06pm

    Osze

    42 posts

    ok, it doesn’t work because of the parsing order.

    You can read about similair problem here:
    http://ellislab.com/forums/viewthread/197371/

    I don’t know how parsing order is changed or if it’s possible.

    I’ve never experience this because I usually use the member details in the URL and then use {segment_x}.

  • #9 / Aug 28, 2011 2:28pm

    bb6600

    13 posts

    I’ve never experience this because I usually use the member details in the URL and then use {segment_x}.

    I’ve tried using {segment_x} as well. It still doesn’t work, so I don’t think it has anything to do with parsing order.

    Everything worked just fine before upgrading to v.2.2.2 (from 2.1.3). I didn’t find anything in the change log regarding parsing order.

  • #10 / Aug 29, 2011 2:14pm

    Kevin Smith

    4784 posts

    Hi bb6600,

    From the tests I ran in 2.2.2, I’m not running any issues getting your test code above to work properly. Be on the lookout for an email from me. I think something else might be at play here, so I want to take a closer look.

  • #11 / Sep 02, 2011 4:14pm

    Sue Crocker

    26054 posts

    bb6600 - just a quick note to mention we’re waiting back on hearing from you. Any news?

  • #12 / Sep 02, 2011 4:52pm

    bb6600

    13 posts

    Sorry, it took a while to fully test the new code. Everything seems to be working fine. Thanks for your support!

  • #13 / Sep 02, 2011 5:01pm

    Sue Crocker

    26054 posts

    Yay! Glad to hear it. I’ll go ahead and close this out. If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases