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.

SOLVED: A Question About URL Segments

July 19, 2007 2:02pm

Subscribe [1]
  • #1 / Jul 19, 2007 2:02pm

    allgood2

    427 posts

    I’m trying to figure out how to use more than 3 url segments. For example, I want to pull an article, while passing additional details about the article via the url.  The current set-up is

    <a href="http://www.sitename.org/{template_group}/{template}/{url_title}/">http://www.sitename.org/{template_group}/{template}/{url_title}/</a>

    So {segment_1}, and {segment_2} belong to the template group and template respectively.

    But I also want to pass on, which category the user clicked on to get to the article, and possibly other details. My first thought was to just use the url_title option in the weblog:entries. If I tell the page that the url_title is at segment_3, or segment_5, it should display the article. So I was hoping one of these url formats would work

    Option 1

    <a href="http://www.sitename.org/{template_group}/{template}/C{category_id}/{url_title}/">http://www.sitename.org/{template_group}/{template}/C{category_id}/{url_title}/</a>  with 
    
    {exp:weblog:entries weblog="digital" limit="1" url_title="{segment_4}"}

    or

    Option 2

    <a href="http://www.sitename.org/{template_group}/{template}/{url_title}/C{category_id}/">http://www.sitename.org/{template_group}/{template}/{url_title}/C{category_id}/</a> with 
    
    {exp:weblog:entries weblog="digital" limit="1" url_title="{segment_3}"}

    Would work, but nothing. Literally nothing. The page returns absolutely nothing. But based on my understanding of the User Guide, you can use up to 9 segments, and if you use the url_title parameter, you can just state which segment contains the url.

    Is it possible for the url_title to be a segment other than {segment_3}?  And if the url_title HAS TO BE {segment_3} is it possible to have other segments after it? Because, if so, I can’t seem to get either situation working in EE 1.6.0 Build:  20070621

  • #2 / Jul 19, 2007 3:44pm

    allgood2

    427 posts

    Nevermind, figured out that you have to specify dynamic=“off” otherwise EE is looking at specific segments.

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

ExpressionEngine News!

#eecms, #events, #releases