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 Issue

January 25, 2011 11:59am

Subscribe [3]
  • #1 / Jan 25, 2011 11:59am

    vacquah

    355 posts

    I am looking to show a list of categories from all my entries using the code below: It is an MSM install - where the site name is “blue”.  I can’t get the category names to show up when I list all the channel names. However they show up if I list only one channel name - like “type-entry”

    ps: The channel names are unique across all the MSM sites.

    {exp:channel:categories 
                     channel="type-entry|type-link|type-photo|type-quote|type-video"
                     site="blue"
                     status="open"
                     show_empty="no"
                     style="linear"
                     }
        
                <a href="http://{path=journal}class=catname">{category_name}</a>
                <span class="catcount">
                {exp:query sql="SELECT count(exp_category_posts.entry_id) AS post_count FROM exp_category_posts WHERE exp_category_posts.cat_id = {category_id} "}
                {post_count}  Entries
                {/exp:query}
                </span>
    
                {/exp:channel:categories}
  • #2 / Jan 26, 2011 3:35am

    John Henry Donovan

    12339 posts

    vacquah,

    What version and build of EE and MSM are you using?

    To confirm. All those channel names belong to the blue site?
    What site is this template code on, another other than blue?

    However they show up if I list only one channel name - like “type-entry”

    They would do if that category group is assigned to that channel. If you have the same category group assigned to multiple channels then any category that has an entry assigned to it regardless of the channel or the parameter you set for channel is going to show here.

  • #3 / Jan 26, 2011 11:05am

    vacquah

    355 posts

    John: Got this resolved. turns out the channel:categories tag allows only one channel ( is this correct ?)

    So I found a plugin on Devotee which goes around the problem. Let me know if there is a generic solution for this - one less plugin for me. thx.


    http://devot-ee.com/add-ons/categories/

  • #4 / Jan 26, 2011 3:18pm

    Ingmar

    29245 posts

    Thanks for letting us know. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases