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.

problem with title_permalink

March 17, 2012 5:18pm

Subscribe [2]
  • #16 / Mar 18, 2012 10:32pm

    Boyink!

    5011 posts

    Sometimes a missing closing HTML tag will “hide” content from displaying but you’ll see in in the rendered source.

    I don’t think the title_permalink variable is the root cause.  It sounds more like the entries loop isn’t returning more than one entry.

    Ditch everything except for the channel:entries loop and the {title} variable.

    So have, in a test template:

    {exp:channel:entries channel="news"}
    {title} 
    
    {/exp:channel:entries}

     

     

     

  • #17 / Mar 18, 2012 10:41pm

    Side Six

    37 posts

    That returned one title, but it should have returned both titles in the channel

    however when I changed “news” to “test” it returned both titles in the test channel

  • #18 / Mar 18, 2012 11:56pm

    Side Six

    37 posts

    Okay I have dumbed it way down.

    The blog index has this code:

    {exp:channel:entries channel="test"}
    {title}

    {test_excerpt}

    {test_body}

    {/exp:channel:entries}

    “news” is the template group and “article” is the template that the title_permalink should resolve to.  There are two entries in the “test” channel.

    The article template consists of the following code:

    {embed="includes/head"}

    {exp:channel:entries channel="test" limit="1" dynamic="no" status="Open"}
    {title}

    {test_body}
    {/exp:channel:entries}

    There is no other code in the blog’s index or the article template

    When I click on the title for “The First Article”  the url resolves to

    http://frank4mv.com/news/article/the-first-article

    But the text is the text for the second article.

    The Second Article
    My father’s family name being Pirrip, and my Christian name Philip, my infant tongue could make of both names nothing longer or more explicit than Pip. So, I called myself Pip, and came to be called Pip. I give Pirrip as my father’s family name, on the authority of his tombstone and my sister - Mrs. Joe Gargery, who married the blacksmith.

    If I click on the the title for “The Second Article” the url resolves to http://frank4mv.com/news/article/the-second-article.

    And the text is correct

    The Second Article
    My father’s family name being Pirrip, and my Christian name Philip, my infant tongue could make of both names nothing longer or more explicit than Pip. So, I called myself Pip, and came to be called Pip. I give Pirrip as my father’s family name, on the authority of his tombstone and my sister - Mrs. Joe Gargery, who married the blacksmith.

    Try it out for yourself at http://frank4mv.com/news

  • #19 / Mar 19, 2012 6:23am

    Boyink!

    5011 posts

    OK - so the index template loop is now returning all entries?

    If so, now start incrementally adding code back in.

    I didn’t see how you were creating links to the article template, but in addition to title_permalink you can also use:

    <a href="http://{url_title_path=news/article}">{title}</a>

    Should be exactly the same result as title_permalink but I prefer this variable as it’s clearer to me what it does - which is append the entry url_title onto the path you specify.

  • #20 / Mar 19, 2012 10:44am

    Side Six

    37 posts

    Actually It’s still only returning one entry at two different urls.  Which means it’s returning the most recent entry regardless of the url which is what it’s been doing all along.  To see what I mean, use the link to the site I’ve been providing. 

    What I’m saying is that even with the code stripped way down, no headers, no footers, no nothing, the title_permalink is returning garbage.  So the problem must lie somewhere else.  A setting, some of the code in Expression Engine itself.  Somewhere else.

  • #21 / Mar 19, 2012 10:51am

    Boyink!

    5011 posts

    Note that the links are correct - they have different url titles. 

    Take “dynamic=“no” out of the article template code.

    You *want* that template to be url-dependent.

    Here’s a screencast explaining what it’s doing:

    http://www.train-ee.com/courseware/free-tutorials/comments/dynamic-off-explained

     

  • #22 / Mar 19, 2012 10:54am

    Boyink!

    5011 posts

    Also - do you have duplicate content in each entry?  I’m assuming that’s the case.  If so don’t do that..makes it hard to verify things..😉

  • #23 / Mar 19, 2012 11:09am

    Side Six

    37 posts

    Taking out the dynamic=“no” did the trick, Michael.  Thanks!

    I must have messed up the display data somewhere when chunking out the page.  Dang thing was driving me nuts.  I hate wasting entire days like that, but I guess it’s a part of it.

    I appreciate the url and the code you shot my way.  That was very generous!

    I hope you’ll give me a heads up if you’re ever in the Orange County area.  I’ll buy you a beer.  And take your class if that’s what you’re doing here. 😊

    Dan

  • #24 / Mar 19, 2012 11:12am

    Boyink!

    5011 posts

    Cool - glad we finally got it sorted. 

    We sold our house this week and should be on the road again in late May - so who knows?  We didn’t see much of South California - but sure hope the CA roads improve before we get back there..😉

  • #25 / Mar 19, 2012 12:15pm

    Side Six

    37 posts

    You mean traffic-wise?  Or the fact that they are falling apart?  Five largest economy in the world and the roads crumble, the schools suck, and we’re near the bottom in terms of literacy.  Still I hope you can make it to South Orange county.  Stop on way to San Diego.  San Diego is a beautiful place!

  • #26 / Mar 19, 2012 12:16pm

    Boyink!

    5011 posts

    Falling apart. Kept being surprised I had a trailer left back there…:gulp:

  • #27 / Mar 19, 2012 2:15pm

    Side Six

    37 posts

    Ouch, not good to lose a trailer.

  • #28 / Mar 19, 2012 3:30pm

    Dan Decker

    7338 posts

    Hi Dan,

    Nice name!

    Big thanks Mike for churning through this with Dan. Awesome as always.

    Since Mike got you all sorted out, is there anything else I can assist you with?

    Cheers,

  • #29 / Mar 19, 2012 6:02pm

    Side Six

    37 posts

    Hi Dan,

    Thanks, but I think I’m good to go.  Unless of course you have $100,000 lying around your place, or a brand new Mac Air so I can code down at Starbucks…

    😊

    Dan

  • #30 / Mar 21, 2012 5:40pm

    Dan Decker

    7338 posts

    Hey Dan!

    I wish!

    If you need anything in the future, just hit us up in a new thread!

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases