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.

Change to URL segment handling?

July 18, 2012 4:16pm

Subscribe [2]
  • #1 / Jul 18, 2012 4:16pm

    Greg Griffith

    37 posts

    I just upgraded from 1.6.8 to 1.7.3, and now I’m seeing odd behavior that wasn’t there before.

    Here’s a description:

    I have two commenting systems, the built-in EE system and Facebook.

    I have these systems accessible through different jQuery tabs.

    On my home page, I have a Recent Comments section.

    Each comment summary is linked to its full version on the article page.

    For the individual entry template to know which comments tab to show (EE or Facebook), I tack on a value in url segment 4, like this:

    .../index.php/group/template/12345/comment-ee

    I then open the appropriate tab by evaluating segment_4.

    This worked fine before my upgrade. Now, while the correct tab is opened and the comments are visible, all of the entry data - title, body, etc. - is gone.

    Can someone provide an explanation, or a link to the docs, that explains what I need to modify so that my entry data is visible again?

    Thanks,

    Greg

  • #2 / Jul 19, 2012 11:37am

    Shane Eckert

    7174 posts

    Hey Greg,

    I am sorry to hear you are running into this snag.

    Is the FB commenting tool an Add-On? Did you upgrade that?

    Would you mind showing me the code you are using for the link that utilizes segment 4?

    Thank you,

  • #3 / Jul 19, 2012 11:56am

    Greg Griffith

    37 posts

    Hi Shane,

    Thanks for replying.

    I’ve actually had Facebook comments disabled for several weeks, due to what appears to be an EE problem with handling the additional query strings FB tacks on to its comment URL’s, but that’s a different matter. (I’d love some help with that later, but for now I need to figure out what’s going on with this problem). Short version is: Facebook comments are unrelated to whatever’s going on here.

    So: The first thing the template does is look for a value in segment_4:

    {assign_variable:commentTab="{segment_4}"}

    Then at the bottom of the template, I do this:

    {if "comment-sf" == "{commentTab}" }
      [removed]
        $(document).ready(function(){
          $('#comments-tabs').tabs({selected:0});
        });
      [removed]
    {/if}

    ... which just tells jQueryUI to apply its tab interface, and activate the first comment tab.

    I have a value in segment_5 that’s the actual comment id, so the page will scroll to the comment.

    The following URL structure works:

    ..../index.php/group/template/entry_id

    But this doesn’t:

    ..../index.php/group/template/entry_id/segment_4/#486023

    Both worked before the upgrade to 1.7.3.

    It’s almost as though the “dynamic” property of the exp:weblog:entries tag is fouled, but setting it explicitly to “on” has no effect.

    exp:comment:entries, though, works fine with both URL structures.

    Thanks for any help you can give me.

  • #4 / Jul 20, 2012 9:06am

    Kevin Smith

    4784 posts

    Hey Greg,

    I get the problem you’re describing. I think the easiest way to troubleshoot this is going to be to have a look first-hand. Be on the lookout for an email from me.

  • #5 / Jul 20, 2012 9:20am

    Greg Griffith

    37 posts

    Thank Kevin! Will do.

  • #6 / Jul 20, 2012 4:29pm

    Kevin Smith

    4784 posts

    Just posting a note here to let onlookers know that we’re working with Greg privately on this for the time being. I’ll post an update back here once we have something to share!

  • #7 / Jul 31, 2012 11:05am

    Greg Griffith

    37 posts

    Thanks to Kevin and Shane for their help!

  • #8 / Jul 31, 2012 12:21pm

    Kevin Smith

    4784 posts

    Got greg all fixed up! The problem ultimately centered around the 4th segment that he was using to trigger which comment tab to show. Since “comments-sf”, for example, looks an awful lot like a URL title, EE was mistaking it for one. That caused EE to not display the entry since no entry had that as its URL title.

    In the template, I changed his main weblog entry tag from this:

    {exp:weblog:entries rdf="off"}

    to this:

    {exp:weblog:entries rdf="off" entry_id="{segment_3}" dynamic="off"}

    And then the entry was displayed properly!

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

ExpressionEngine News!

#eecms, #events, #releases