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.

Unable to reference url_title for entries

February 14, 2011 4:43pm

Subscribe [2]
  • #1 / Feb 14, 2011 4:43pm

    mattwildman

    6 posts

    I’m using the latest build of EE2 and I’m running into an issue where I’m not able to reference the url_title of entries. If I specify the entry_id instead, everything works as it should. However, I want to create generic templates that I can reuse throughout the site.

    Works:

    {exp:channel:entries channel="{product_channel}" entry_id="{product_id}"}

    Doesn’t work:

    {exp:channel:entries channel="{product_channel}" url_title="{product_url_title}"}

    I’ve also tried referencing {segment2} and {segment1} but that doesn’t work either. Any ideas on what might be happening. For this particular site, I’m using the Structure add-on. Could this be causing the issue? Anything I should try or another approach that might allow me to make generic templates that I can deploy over the site?

  • #2 / Feb 14, 2011 4:49pm

    mattwildman

    6 posts

    where {preload_replace:product_url_title="url_title"}

  • #3 / Feb 15, 2011 9:04am

    Sue Crocker

    26054 posts

    Hi, Matt. Are you always going to be passing in the url_title via segment_3? That’s normally how you do things. EE “sees” the third segment, and knows that is the url_title..

  • #4 / Feb 15, 2011 12:10pm

    mattwildman

    6 posts

    I’m not passing in the url_title via segment_3 now. I want to reference a specific url_title as a string. The url_title I’ll be referencing is in the location of productname here: site.com/products/productname. However, using either segment_2 or productname in the url_title parameter in exp:channel:entries does not work. I have to pass the entry_id for the encapsulated code to execute. However, there is no way that I know of to allow the entry_id parameter to be dynamic. The url_title can be dynamic if I reference segment_2. The weird thing is, my previous test builds of ee2 worked fine with passing in the url_title.

    Not sure if I’m doing anything wrong on the EE2 side or if the Structure add-on is messing with my url_titles. I’m inclined to think the former because after the channel initiates, calling a url_title provides me with the exact string I was trying to pass it in the parameters.

  • #5 / Feb 15, 2011 5:05pm

    Ingmar

    29245 posts

    Can you show us a little more of your code, perhaps a link? When you use {segment_2} and {segment_3} on their own in your template, do they show as expected?

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

ExpressionEngine News!

#eecms, #events, #releases