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.

URL's not using URL titles

August 08, 2011 6:56am

Subscribe [3]
  • #1 / Aug 08, 2011 6:56am

    Evolve Websites

    110 posts

    Hi there,

    A basic one I’m sure, but got me stumpted none the less. Here goes…

    I’m trying to get a site to use the URL title in the URL, rather than the entry ID.

    Here’s the site: http://training.customstudio.co.uk/portfolio/detail/16

    The entry has a URL title set, and it’s displayed if I paste it into the browser, but by default it displays entry ID.

    I suspect there’s a setting I haven’t found (despite looking).

    Any help is appreciated!

  • #2 / Aug 08, 2011 7:25am

    Dave @ Exp:resso

    465 posts

    Well maybe I’m missing something too but it should work fine with an entry_id OR a url_title. EE should automatically be able to use either to display the correct entry. If you have dynamic=“no” and are hardcoding url_title=”{segment_3}” then this could cause issues though.

    But why are you linking to the url with the entry id anyway? Wheres the link that spits out http://training.customstudio.co.uk/portfolio/detail/16 ? In your portfolio list page, you should link to the detail page using the url_title

    Hope this helps!

  • #3 / Aug 08, 2011 7:59am

    Evolve Websites

    110 posts

    Hi Dave,

    Thanks for your email.

    I’m using the following code to display my portfolio list, which is linking to the entry id:

    <h3>Our Portfolio:</h3>
    <p>                    <ul><br />
                            {exp:channel:entries channel="portfolio" dynamic="no" orderby="title" sort="asc"}<br />
                                <li><a href="http://{permalink=">{title}</a></li><br />
                            {/exp:channel:entries}<br />
                        </ul>

    PLEASE NOTE: The forum is editing some of the code. Sould read… permalink=“portfolio/detail”

    Does that make sense?

  • #4 / Aug 08, 2011 8:01am

    Dave @ Exp:resso

    465 posts

    Well shouldn’t the link be href=”{url_title_path='portfolio/detail'}” or href=”{path='portfolio/detail/{url_title}’}”

  • #5 / Aug 08, 2011 8:04am

    Evolve Websites

    110 posts

    BINGO!

    Thanks Dave!

  • #6 / Aug 08, 2011 8:05am

    Dave @ Exp:resso

    465 posts

    No worries, glad you got it sorted!

  • #7 / Aug 08, 2011 12:21pm

    Sue Crocker

    26054 posts

    Thanks for the assist, Dave.

    Custom Studio - looks like things are working for you again.. 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