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 use category title instead of c4, c5

August 23, 2007 12:34am

Subscribe [1]
  • #1 / Aug 23, 2007 12:34am

    insomnie

    56 posts

    How would I link to a page like this,

    something/category/nameofcategory

    Instead of the default way ,

    something/category/C4
  • #2 / Aug 23, 2007 12:39am

    Lisa Wess

    20502 posts

    Head to Admin -> Weblog Administration -> Global Weblog Preferences and turn on the use of category names in the URL.

  • #3 / Aug 23, 2007 12:50am

    insomnie

    56 posts

    Hey thanks for quick response! I am also wondering on how to create a template for each category type. I imagine it could be one file with if/else ?

    Here is what i use for listing categories:

    {exp:weblog:categories weblog="talkaboutdesign" dynamic="off" class="fix"} 
    <a href="http://{path=">{category_name} </a>
    {/exp:weblog:categories}

    site is a default folder and then the rest of the url is made up. In the end my urls look like this:

    <a href="http://www.thnort.com/index.php/site/category/advertising/">http://www.thnort.com/index.php/site/category/advertising/</a>
  • #4 / Aug 23, 2007 12:53am

    insomnie

    56 posts

    I am in the middle of moving all my stuff from wordpress to ee. Original site talkaboutdesign and working ee copy thnort

    What you think so far?

  • #5 / Aug 23, 2007 12:55am

    Lisa Wess

    20502 posts

    Could you expand upon what you mean by “category type”?  Generally speaking, if you need a different look/feel, you’ll be best off using a separate weblog, custom field, or status for that data.

  • #6 / Aug 23, 2007 12:58am

    insomnie

    56 posts

    For example, I have a post and it’s filed under a category “ads”. When I click on the category link “ads” i want to have a page for that. (Good example is archives with all the posts from that category)

  • #7 / Aug 23, 2007 1:00am

    Lisa Wess

    20502 posts

    Yes, that is fine, but you don’t need separate templates.  Have a read of this article =)

  • #8 / Aug 23, 2007 1:01am

    insomnie

    56 posts

    You know there is even that tab under categories for category description. Or even image for that category. Basically what i am looking for is an archive view for each category.

  • #9 / Aug 23, 2007 1:08am

    insomnie

    56 posts

    Thanks for the link, I get it now. However its using the same template from the homepage. And i want to create a new template that displays archives. So from my understanding i would need to create a new template group, such as archives, and then use the index template in that file to style my page. And in my category list url use archive/ instead of site/ . Am I correct?

  • #10 / Aug 23, 2007 1:12am

    Lisa Wess

    20502 posts

    Nope, you do not need to create a new template group.  Just create a new template in your existing template group and point your path statements to that.  You should read up on path variables =)

  • #11 / Aug 23, 2007 1:17am

    insomnie

    56 posts

    Nope, you do not need to create a new template group.  Just create a new template in your existing template group and point your path statements to that.  You should read up on path variables =)


    Yea but I want the url to be simple http://www.site.com/archive/category/ads

    If I make a template inside a current folder my url will look like this

    http://www.site.com/site/archive/category/ads

  • #12 / Aug 23, 2007 1:26am

    Lisa Wess

    20502 posts

    I personally think that the latter URL looks fine, and is highly informative and SEO friendly. But yes, if you want to shorten the URL, the safest thing is to make a template group for it and just omit the “index” template - EE will assume you are using the index in that case.

  • #13 / Aug 23, 2007 1:30am

    insomnie

    56 posts

    I agree with you about the first url. I am rethinking how I will structure my site. Question, is there a way to remove that default directory from the url? So that even if I have a site group I can hide it?

  • #14 / Aug 23, 2007 2:37am

    Lisa Wess

    20502 posts

    I’m not quite sure I’m following, if you use path= statements always then they will point to the template_group/template_name that you specify. You can keep “site” and never use it if you prefer.

    Or if you build your URLs in some other way, just point to the appropriate location, of course. =)

  • #15 / Aug 23, 2007 10:59am

    insomnie

    56 posts

    I’m not quite sure I’m following, if you use path= statements always then they will point to the template_group/template_name that you specify. You can keep “site” and never use it if you prefer.

    Or if you build your URLs in some other way, just point to the appropriate location, of course. =)

    What I mean is can I keep the template_group/template_name but not show template_group in the url structure.

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

ExpressionEngine News!

#eecms, #events, #releases