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.

Recent Comments and Category URLs?

August 24, 2010 6:47pm

Subscribe [2]
  • #1 / Aug 24, 2010 6:47pm

    The best way to explain what I would like to do is probably by looking at the code below:

    Latest Comments
    
    {exp:comment:entries sort="desc" orderby="date" limit="10" dynamic="off" weblog="drugs"}
    
    By {name} on {comment_date format="%d/%m/%Y"}
    
    
    <a href="http://{url_title_path=drugs/CATEGORY-URL-TITLE-OR-NAME-GOES-HERE}">View entry</a>.
    
    {/exp:comment:entries}

    I’m listing the 10 most recent comments on our site, that function is fine but linking to the relevant article is not. Our site URLs look like this: site.com/weblog-name/category-name/article-title

    I can list the comments and have them link to site.com/weblog-name/article-name but on our site that is the wrong URL and gives a 404.

    Is there any workaround for this? Any help would be greatly appreciated.

  • #2 / Aug 25, 2010 4:05pm

    Bump?

  • #3 / Aug 26, 2010 3:05am

    John Henry Donovan

    12339 posts

    Uncommon Knowledge,

    Just a note that if you bump a thread in our forums it is pretty ineffective as we answer threads in the order they are received so a bump will put you at the bottom of that list again.

    You are using a non standard URL to try an reach an entry here.
    Like you said a typical single entry url will look like
    http://www.mydomain.com/index.php/weblog/comments/ice_cream/

    To find out the category you are going to need to do a query I’d say which will be quite performance intensive if you have a lot of comments

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

ExpressionEngine News!

#eecms, #events, #releases