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.

Category/Subcategory URLs

April 20, 2008 12:31pm

Subscribe [3]
  • #1 / Apr 20, 2008 12:31pm

    nek4life

    32 posts

    I’ve never used the subcategory features with EE and I was wondering if anyone new the URL behavior so I can use segment conditionals to highlight active links. 

    With one category the url looks like:

    http://www.site.com/blog/category/category_name/

    Would the url with a sub category look like?

    http://www.site.com/blog/category/category_name/sub_category_name

  • #2 / Apr 20, 2008 12:42pm

    Robin Sowell

    13255 posts

    No- url structure is the same no matter how deep the category is (which can be good if you nest deeply- the urls could get huge).  So: http://www.site.com/blog/category/category_name/ is the structure used regardless.

    To highlight the active segment, you can likely use {category_url_title} and compare to segment_3 (alter as needed)- will that do the trick?  And does it make sense?

  • #3 / Apr 20, 2008 12:55pm

    nek4life

    32 posts

    Thanks Robin,

    Yeah that’s what I already do for the for the highlighting or something similar to that.  However I’d like to be able to drill down like digg.com.  I’m trying to figure out the structure of a site, whether it would be better to run 1 blog with categories and sub categories, or if I’ll have to run 10 different blogs with categories to be able to drill down.  It’s a major decision so I’m doing research and trying to figure it out before I start coding.

    Does that make sense?

  • #4 / Apr 20, 2008 1:10pm

    Robin Sowell

    13255 posts

    Not quite- I’m fuzzy on ‘drill down’- but if it’s what I’m thinking, EE allows it pretty much by default.

    Say- you have top level cats: movie, tv, music- and you have a subcat ‘Smallville’ in tv.  Go to ‘tv’- see all entries in that cat (including those assigned to ‘Smallville’- go to ‘Smallville’- just see entries in ‘Smallville’.

    That what you want?  In which case, that’s pretty much stock behavior.  Can be overridden if you set entries to not be assigned to parents by default, but you’d have to do that on purpose.

    Or am I not getting ‘drill down’?

  • #5 / Apr 20, 2008 2:10pm

    nek4life

    32 posts

    Alright let me explain a little further.

    so here are some main category examples.  General Info, Recipes, News

    subcategories. green pepper, red pepper, bananas, oranges, etc…

    so I clicked on the general info tab it would show me general info from each of the subcategories.  then I would like to “drill down” again so I click on the green pepper tab.  I would then like to see all the general info about green peppers.

    I think in writing this out I answered my own question.  I need to have 3 blogs for the main sections with categories for all the foods. 4 templates groups, 1 that shows all 3 blogs together and 1 for each individual blog.

  • #6 / Apr 21, 2008 1:21pm

    Robin Sowell

    13255 posts

    Hm, yep, that makes sense to me- with one category group shared between the blogs.  Can see other ways of doing it, but this might well be the approach I’d take.

    Will leave open for now- but otherwise, you all squared away?

  • #7 / Apr 21, 2008 3:54pm

    nek4life

    32 posts

    As squared away as I’m going to get 😊  Just curious but what other approaches would you take?  Or can you point me to some EE site structure threads where I could check out some other ideas. Thanks.

  • #8 / Apr 21, 2008 4:49pm

    Ingmar

    29245 posts

    I can only speculate about what Robin meant in detail, but url_segments would be a natural way to tackle something like that.

  • #9 / Apr 22, 2008 9:54pm

    nek4life

    32 posts

    Definitely some more thinking to do.  Thanks for all the help this should get me where I need to go.

  • #10 / Apr 22, 2008 9:58pm

    Sue Crocker

    26054 posts

    Closing thread…

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

ExpressionEngine News!

#eecms, #events, #releases