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.

Multiple weblogs using 1 category group

September 15, 2008 12:14am

Subscribe [2]
  • #1 / Sep 15, 2008 12:14am

    Haydar

    2 posts

    I have tried to find information about this topic on the forum and in the user manual and wiki, but I think I am missing something. I’m working on my first EE site. It’s for a public school counseling dept. The 3 grade counselors—6,7,8—each have their own weblog and their their own template for their grade. They each use the same category group in their group preferences. I would like each of their blogs to list only the categories they have tagged in their own posts. Currently, the 6th grade categories are showing up on the 7th and 8th grade pages, even though the latter two haven’t made any entries yet (and so, to my mind, should not have any categories at all listed on their respective generated pages). As an example, here is the code for the 7th grade sidebar where the list shows:

    <!-- side -->
                    <div id="smaller">
                        <div class="smaller-c">
                            {embed="code-snippets/7th-grade-contact"}
                            {embed="code-snippets/search"}
                            {embed="code-snippets/categories" my_weblog="{my_weblog}" my_template_group="{my_template_group}"}
                            {embed="code-snippets/monthly-archives" my_weblog="{my_weblog}" my_template_group="{my_template_group}"}
                            {embed="code-snippets/mailing-list"}
                        </div><!-- close smaller-c -->
                    </div><!-- close smaller -->
                <!-- end side -->

    and here’s the “code-snippets/categories” code for that line above:

    <div class="box-1">
        <div class="box-h"><h4 id="h-categories">Categories</h4></div>
        {exp:weblog:categories weblog="{embed:my_weblog}" style="nested" show_empty="no"}
        <a href="http://{path={embed:my_template_group}/{embed:my_weblog}}">{category_name}</a>
        {/exp:weblog:categories}
    </div>

    The variables “my_weblog” and “my_template_group” are defined for each grade at the top of each template.

    Questions:
    1) Is it possible to do what I would like: have 3 weblogs share the same category group and have the category lists show only for those categories used for each specific weblog?

    2) If so, what am I dong wrong above?

    3) If not, then is my assumption correct that I have to create separate, even though identical, category groups for each weblog?

    Thanks for any help to this newcomer.

  • #2 / Sep 19, 2008 8:02am

    Wolfram

    115 posts

    Hello Haydar,
    I just came across the same question and found out that we are not alone. There is a feature request for listing the categories based on a certain weblog. In the thread you will find code by “Slapshotw” that works well for me. Maybe it helps you, too.

    Wolfram

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

ExpressionEngine News!

#eecms, #events, #releases