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 Archives from Multiple Weblogs

April 24, 2008 7:14pm

Subscribe [2]
  • #1 / Apr 24, 2008 7:14pm

    rumsey

    12 posts

    I have multiple weblogs using the same category group and categories.  I’d like to set up an archive page listing every entry, regardless of weblog, under the appropriate category name. 

    Example:

    <h3>Category 1</h3>
    <p><ul><br />
         <li>Entry from Weblog 1</li><br />
         <li>Entry from Weblog 2</li><br />
    </ul></p>
    
    <h3>Category 2</h3>
    <p><ul><br />
         <li>Entry from Weblog 1</li><br />
         <li>Entry from Weblog 2</li><br />
    </ul></p>
    
    <h3>Category 3</h3>
    <p><ul><br />
         <li>Entry from Weblog 1</li><br />
         <li>Entry from Weblog 2</li><br />
    </ul>

    I know it’s not possible using the category_archive tag, but is there a work-a-round?

    Moderator’s note: Moved to Howto

  • #2 / Apr 24, 2008 9:23pm

    Sue Crocker

    26054 posts

    rumsey, are you using subcategories as well, or just first level categories?

  • #3 / Apr 25, 2008 10:13am

    rumsey

    12 posts

    Currently, just first level, but I may use subcategories depending on whether or not it can be done.

  • #4 / Apr 25, 2008 10:18am

    Sue Crocker

    26054 posts

    I’d do it using the query module. I don’t have a good example on any of my sites, but I do on one of my client sites. Hold on a bit and I’ll see if I can find it.

  • #5 / Apr 25, 2008 1:36pm

    rumsey

    12 posts

    Thanks, any help would be much appreciated.

  • #6 / Apr 29, 2008 4:53pm

    Sue Crocker

    26054 posts

    Rumsy, this code is specific for my needs and is meant to be a starting point for you, not a full solution. Just enough to get started.

    <table width="465px" cellpadding=5>
    <tr>
    <td colspan="2"><a href="http://{path=shop/shownew}"><strong>New Merchants</strong></a>{tab}http://s3.amazonaws.com/shopinus_files/ShopInDirectories/new1.gif</a>
    View caring merchants who are new to our program
    </td>
    </tr>
    {exp:weblog:categories weblog="shop" dynamic="off" style="linear" parent_only="yes" show="not 26"}
    <?php
    if ($i % 2 == 0) {
    echo "<tr>";
    }
    ?>
    <td width="50%">
    <div class="{switchplus} parent"><a href="http://{path=shop/showparent/category/{category_url_title}}"><strong>{category_name}</strong></a>
    
    {category_description}
    
    
    </div>
    <div class="pad5">
    {exp:query sql="select cat_id, cat_name, cat_url_title from exp_categories where group_id = 3 and parent_id = '{category_id}' order by cat_name asc limit 3"}
    <a href="http://{gohome}/shop/showchild/category/{cat_url_title}">{cat_name}</a> 
    {/exp:query}</div>
    </td>
    
    <?php
    if ($i % 2 == 2) {
    echo "</tr>";
    }
    $i++;
    ?>
    
    {/exp:weblog:categories}
    
    </table> 
    {/exp:switchplus}

    I’m using a few 3rd party items

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

ExpressionEngine News!

#eecms, #events, #releases