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 assign multiple category groups to a weblog?

July 09, 2007 2:55am

Subscribe [2]
  • #1 / Jul 09, 2007 2:55am

    Arun Shanbhag

    15 posts

    In the trial version of my Newsletter Site: 
    http://www.achesandjoints.com
    I have currently assigned categories based on the topic to each of the articles.

    All these five articles are from the same Issue of the Newsletter.  As we go to the next issue, I need to include a second category group for “Issue”.

    In the tens of forum articles I have read, everyone casually says,  “In EE, you can assign multiple category groups to each weblog”, but I have been unable to find any information on how to go about doing it.

    Can someone help/guide me in this process?  I would like a second category group called “Issue” under which I will likely have the categories: “Issue 1 April 2007, Issue 2 Aug 2007, ... etc”  These article will still be assigned to the first category group (based on topics) as well.

    Many thanks,
    Arun

  • #2 / Jul 09, 2007 6:36am

    silenz

    1651 posts

    CP Home ›  Admin ›  Weblog Administration ›  Weblog Management
    Find the weblog in question and click ‘Edit Groups’.
    There you can select one or any number of category-groups from the list by keeping the CTRL-key pressed.

  • #3 / Jul 09, 2007 8:13am

    Arun Shanbhag

    15 posts

    Thank you Silencz,
    That was perfect and so straight forward.

    As a follow-up, I created a second group and selected that as well.  Now on the sidebar on my site, I have a long list of categories (from both groups) listed under the one heading of “Category.”  (see http://www.achesandjoints.com)

    Is there a way to separate the listing of the two category groups on the site itself?  And to make it a drop-down list?

    Arun

  • #4 / Jul 09, 2007 8:44am

    Daniel Walton

    553 posts

    use the category_group=”” parameter available for the weblog categories tag (assuming this is the tag you’ve utilised here) and use the tag once for each list you wish to display.

  • #5 / Jul 09, 2007 10:21am

    Robin Sowell

    13255 posts

    the_butcher is dead on- you can control the cat group displaed in the category list via the category group parameter.

  • #6 / Jul 09, 2007 11:37am

    Arun Shanbhag

    15 posts

    Hi Help!

    This was the original code for the categories

    <h2 class="sidetitle">Categories</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    

    I tried to use the {category_group=""} tag as recommended.  See code below
    Obviously, I am doing something wrong.  See the site as it is live and you can see the errors in the sidebar. :-(
    http://www.achesandjoints.com
    Can you tell me please, how to fix this?  In the category groups,  I have made
    1. the Default category, which has the topics (Arthroplasty, Spine, etc)
    2. The Issues category (Issue 1, April 2007; etc)
    is this the right way to use this tag?

    <h2 class="sidetitle">Categories</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested"}
    {category_group="1"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    
    
    <h2 class="sidetitle">Issues</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested"}
    {category_group="2"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    
  • #7 / Jul 09, 2007 11:40am

    Robin Sowell

    13255 posts

    Ah- no, it’s a parameter for the categories tag- not a variable pair.  Try:

    <h2 class="sidetitle">Categories</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested" category_group="1"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    
    
    <h2 class="sidetitle">Issues</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested" category_group="2"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    

    As long as your group id’s are correct in the above, it should do what you’re looking for.

  • #8 / Jul 09, 2007 11:46am

    Arun Shanbhag

    15 posts

    A related query;  After each entry, I only want the categories from Group one to be listed.  Currently, categories from both groups are listed.  See current code:

    {categories}
    <a href="http://{path=site_index}">{category_name}</a> •
    {/categories}

    How do I modify this so only categories from group 1 are listed.

    Thanks for your help.
    Arun

  • #9 / Jul 09, 2007 11:50am

    Robin Sowell

    13255 posts

    Not a problem- for the details, see the docs on that variable pair.  The short answer is- you do:

    {categories show_group="1"}
    <a href="http://{path=site_index}">{category_name}</a> •
    {/categories}
  • #10 / Jul 09, 2007 11:56am

    Arun Shanbhag

    15 posts

    Robin!  Yoo Hoo!
    It worked.
    I modified the groups as you suggested.  WoW!  It works!

    Also, for the related query I included the show_groups and that worked too!

    WoW!  I think I am going to like this program.
    Many thanks for your help.

    😊

  • #11 / Jul 09, 2007 12:00pm

    Robin Sowell

    13255 posts

    LOL- glad you’re pleased.  (I use categories a ton in pretty much the same way you’re doing.  I was SO HAPPY when they added the ability to assign multiple category groups to a weblog.  Adds a lot of flexibility!)

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

ExpressionEngine News!

#eecms, #events, #releases