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.

Dynamic category URLs not working

April 19, 2011 1:26pm

Subscribe [2]
  • #1 / Apr 19, 2011 1:26pm

    scottb

    348 posts

    For some reason, the code on the page below doesn’t work for the category URLs. If you look at the first item, see the word CHURCHES in red? Wave your cursor over it, and you will see that the path has the letter C for the category but not the category ID number.

    http://www.thenewsrecord.com/index.php?/directory/

    Here is a simplified version of the code, which I use without trouble elsewhere on the site:

    {exp:weblog:entries weblog="directory" dynamic="on"}
    
    {categories}<a href="http://{path={segment_1}/categories/}">{category_name}</a>{/categories}
    
    {/exp:weblog:entries}

    However, when I type in the full path including the category ID, I get the correct listings for that category. Any suggestions?

    The version is 1.6.9 and the build is 20100430.

  • #2 / Apr 20, 2011 12:05am

    Lisa Wess

    20502 posts

    Hi, Scott -

    Interesting, I haven’t seen it leave off just the number before.

    Can you try this on an otherwise blank template? I want to rule out template interference:

    {exp:weblog:entries weblog="directory" dynamic="on"}
    
    {categories}<<a href="http://{path=weblog/index}">{category_name}</a>{/categories}
    
    {/exp:weblog:entries}

    I am removing the segment item as well, this is just reduction testing, we’ll go further once we get the basic code working.

    This should end up being output in a test template with black text on a white page and no styling.  Please give us a link to that template once you have it set up.

    Thanks!

  • #3 / Apr 20, 2011 1:08pm

    scottb

    348 posts

    Greetings, Lisa. Here is the result:

    http://www.thenewsrecord.com/index.php?/directory/blank_test/

    Any chance there is a limit on the number of categories that the system can handle? This client has about 290 of them for the weblog above.

  • #4 / Apr 20, 2011 3:56pm

    Lisa Wess

    20502 posts

    Meh, that’s rough. Can you make it this:

    {exp:weblog:entries weblog="directory" dynamic="on"}
    <strong>{title}</strong>
    
    {categories}Categories: <a href="http://{path=weblog/index}">{category_name}</a>{/categories} 
    
    
    {/exp:weblog:entries}

    and let us know when updated? Should make it easier to read.

    And no, I’ve seen many times that number of categories. =)

  • #5 / Apr 20, 2011 3:58pm

    Lisa Wess

    20502 posts

    Also, Scott - did you want category IDs or URL titles in the URL?  Can you let us know what it says in Admin > Weblog Administration > Global Weblog Preferences for “Use Category URL Title in URL”?

    You might also temporarily try flipping that and see if that changes the output.

    Lastly, did you do any data imports into this installation?

    Thanks!

  • #6 / Apr 21, 2011 11:52am

    scottb

    348 posts

    Here is the updated page:

    http://www.thenewsrecord.com/index.php?/directory/blank_test/

    Use Category URL Title in URL was set to no. (It is used that way for other weblog categories.) When I set it to Yes and reloaded the page, the links showed the reserved word Category and the category URL title. Flipping it back gave a blank ID again.

    And yes, I did do a data import, but I used a process that I regularly use with no trouble. SQL Manager / Manage Database Tables / exp_categories shows the cat_id, site_id and group_id for the upload seem to be fine.

  • #7 / Apr 22, 2011 4:03pm

    Brandon Jones

    5500 posts

    Scott,

    Can you try disabling any extensions you might have? If you add a new category normally in the CP, does it get its ID output correctly?

  • #8 / Apr 25, 2011 1:30pm

    scottb

    348 posts

    Brandon, the site doesn’t have any extensions, and I see an ID output for my test category.

    I should also mention that the content I uploaded under Edit and Categories shows that each entry is correctly categorized.

  • #9 / Apr 25, 2011 3:47pm

    Brandon Jones

    5500 posts

    Hi Scott,

    If that’s the case I’d highly recommend going back and looking at your import process. If new categories work correctly I suspect something went amiss there. DataGrab is also a great alternative way to import data.

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

ExpressionEngine News!

#eecms, #events, #releases