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.

how to display category in url

August 31, 2008 9:27am

Subscribe [3]
  • #1 / Aug 31, 2008 9:27am

    roman-vc

    46 posts

    hi, if i get it right, the category is always part of the url.
    actually don’t know why the category doesn’t show up in our urls?
    this is the part of the template relevant for the display in the article:
    {exp:weblog:entries weblog="{embed:weblog}” orderby=“date” sort=“desc” limit=”{embed:limit}” category=”{embed:category}” offset=”{embed:offset}” disable=“trackbacks” dynamic=“off”}
    <div class=“hentry clearfix”>
      <h5 class=“subheading”>{title}</h5>
      {entry_date format=' %l, %d. %F %Y '} by {author}
    {if en_body}{article_image_thumb}{if:else}{article_image_thumb}{/if}
      {en_summary}
    </div>
    {if en_body}MORE…{/if}
    <!—{categories}{category_id} - {category_name} / {/categories}—>
    {/exp:weblog:entries}
    What do i need to add where, so that the category becomes part of the url?
    I’ve been searching since yesterday already which is about ten hours but i can’t find the solution.
    And “yes”, i’ve set “use category url titles in links” to yes and the category url indicator is set to category.
    Please help

  • #2 / Aug 31, 2008 10:01am

    Sue Crocker

    26054 posts

    Greetings Roman.

    {exp:weblog:entries weblog="{embed:weblog}" orderby="date" sort="desc" limit="{embed:limit}" category="{embed:category}" offset="{embed:offset}" disable="trackbacks" dynamic="off"}

    This tells me you’re using an embed to show content of some sort.

    In this template, what happens if you do the following before the exp:weblog:entries tag?

    Debug: The value of weblog = {embed:weblog}, limit is {embed:limit}, category is {embed:category}

    Or is that what you’re trying to do?

    The category isn’t always a part of your URL - do you have a link where we can see this behavior?

  • #3 / Aug 31, 2008 10:06am

    roman-vc

    46 posts

    here’s one link: http://www.berlinista.com/en/article/marc-houle-sixty-four/6385
    actually i didn’t build the site myself and now i have to figure out how expression engine works whenever i want to change a thing.
    Thanks’ for the fast reply!!!

  • #4 / Aug 31, 2008 1:36pm

    roman-vc

    46 posts

    If i add the code you provided before the {exp:weblog:entries weblog="{embed:weblog}” orderby=“date” sort=“desc” limit=”{embed:limit}” category=”{embed:category}” offset=”{embed:offset}” disable=“trackbacks” dynamic=“off”} the code shows up as part of the entry on the article site above the article picture.
    As you didn’t quite understand what i’m trying to do, i wanna change the url from http://www.berlinista.com/en/article/marc-houle-sixty-four/6385 to http://www.berlinista.com/en/article/music/marc-houle-sixty-four/6385, where “music” is the category.
    If the categories aren’t a basic part of the urls it makes me wonder why i have to choose in the global weblog preferences if i wanna choose category url titles in links and why i have to choose a category url indicator if it doesn’t show up in the end.
    actually i’m just the end-user of ee and not a programmer and for several reasons i can’t ask the guy who set up our website to change that… there are several problems we run to in google search and i have to change some things step by step in order to get our articles to appear correct in google. a search result which shows the title of our page as the headline and contains the headlines of random articles from our site as the summary with a completely wrong url at the bottom doesn’t make much sense to me. for that reason i have to change things so that google is able to read our site properly.

  • #5 / Aug 31, 2008 7:44pm

    Jack McDade

    425 posts

    Hey, you can put your code inside

    brackets so we can read it easier and therefore give ya a hand quicker. 😊

  • #6 / Sep 01, 2008 9:24am

    Herb

    224 posts

    Category URL titles simply defines how ee interprets whether it should use the trigger “C” plus the category id or the category title when to determine if it is to display a category listing page.  I suggest you read: http://ellislab.com/blog/entry/the_importance_of_semantics/

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

ExpressionEngine News!

#eecms, #events, #releases