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 display categories alphabetically in columns?

November 20, 2012 1:46pm

Subscribe [1]
  • #1 / Nov 20, 2012 1:46pm

    sparky

    17 posts

    I’m hoping this is an easy question, but not so sure?
    I’ve bee trying to display categories in columns (easy), and also alphabetically by column from top to bottom like a phone book layout (not so easy).

    Here’s what I currently have:

    {exp:channel:categories channel="resources" parent_only="yes" style="linear"}
        
        <div class="one-fourth directory">
        <a href="http://{path=resources}">{category_name}</a>
        
        (
        {exp:query sql="
         SELECT 
          COUNT(entry_id) AS total_entry_count
         FROM
          <SQL_Entry>
         WHERE
          cat_id = {category_id}
        "} 
    
         {total_entry_count}
    
        {/exp:query})
        
        </div>
        
     {/exp:channel:categories}

    While this sort of works, it will display the items in alphabetical order from left to right (rows) and not top to bottom (columns), which is expected.
    I tried the “Splitter” plugin but it didn’t work for me and the same results were produced.

    If you know of a way your help is greatly appreciated!

  • #2 / Nov 20, 2012 1:57pm

    MadWebDesigns

    147 posts

    Hi sparky,

    Have a look at this plugin:

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

    This should help simplify things for you.

    Cheers,

    Mike

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

ExpressionEngine News!

#eecms, #events, #releases