Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   3 or 4 column category list (/showthread.php?t=3719)

ayorofrance January 19th, 2011 11:40 PM

3 or 4 column category list
 
Hi Eric,

I would like to list all my top categories at the bottom of all category pages (and the front page).

This is not too difficult to do, however my category names are fairly short, so I'd like to go with 3 or 4 column...

I gave it a shot hacking the category list code as follows:
Code:

<h2>Our shop categories are:</h2>
<!-- Category List -->
[category.list id='dfcatcol1' before='<div class="cl">' after='</div>']
  <div class="cell col2">
    <div class="bdr">
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.list id='dfcatcol2' before='<div class="cl">' after='</div>']
        <div class="cell col3">
          <div class="bdr">
            <a href="[category.link]" title="[category.name]">[category.name]</a>
            [category.list id='dfcatcol3' before='<ul>' after='</ul>']
              <li>
                <a href="[category.link]" title="[category.name]">[category.name]</a>
                [category.repeat id='dfcatcol3']
              </li>
            [/category.list]
        </div>
      </div>
      [/category.list]
    </div>
  </div>
[/category.list]
<!-- /Category List -->

However that did not produce any good results...

Is there an easy way I can add extra columns?

Thanks!

Eric January 20th, 2011 09:10 AM

Creating multi-column lists is very tricky in general. Usually for multi-column lists to work, you need to know how many items you have in a column before it can work and assign each item in the list specific CSS.

Long articles have been written on how to do this: http://www.alistapart.com/articles/multicolumnlists/

What makes it even more complicated is how to handle child categories.

So the first questions that need to be answered are:
1. are you showing child categories?
2. can you forsake the hierarchical display of your categories
3. how many categories will be displayed
4. are you willing to forget a <ul> list and use a <div>?

Eric

ayorofrance January 20th, 2011 10:51 AM

Hi Eric,

Complicated is not good :-)

But to answer your questions:
1. are you showing child categories?

No - just top level.

2. can you forsake the hierarchical display of your categories

Sure - just need to list the categories hyperlinked.

3. how many categories will be displayed

Probably 30 - 60 eventually... now only 3...

4. are you willing to forget a <ul> list and use a <div>?

No problem...

If it's too hard i'll just do in manually...

Categories won't change too often...

Cheers,

Anders

Eric January 20th, 2011 03:08 PM

Phew... that was a little tricky: /showthread.php?t=3730

ayorofrance January 21st, 2011 11:21 AM

You have certainly made it look easy! ;-)

Amazing, Eric... THANKS!


All times are GMT -5. The time now is 01:09 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.