Webmastersite.net
Register Log In

Vertical alphabetical category listing

Comments on Vertical alphabetical category listing

qwqw
Member

Usergroup: Customer
Joined: Feb 16, 2003

Total Topics: 9
Total Comments: 15
qwqw
Posted Aug 13, 2005 - 2:11 PM:

I want to list my category vertically by geographical names.

Currently I can only put categories alphabetically only horizontally ( I use 3-4 columns)

Alabama ---- Alaska ------- Arizona
Arkanzas ----California ----Colorado


But I want to put them vertically as most readers will read columns vertically:

Alabama --- Arkanzas
Alaska --- California
Arizona --- Colorado

Of course I can rename all of them in the vertical order

but I' will be adding more categories ( for cities) and I would not be able to rename the categories all the time to fit a category in it's alphabetical spot.

So how do put all categories alphabetically vertically?

Thanks
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 14, 2005 - 4:34 AM:

Possibly some sort of container <div> could make things stack vertically, but table cells aren't really made to allow that. I guess you could set the columns to 0, remove all the table-related html, then do something along the lines of

<div style="float: left; width: 45%;">

stuff
<?php if ({CATNUMBER} == int({CATNUMSUB} / 2)) { echo '</div><div style="float: left; width: 45%;">'; } ?>

</div>


presuming I remembered the template var for the number of subcategories correctly there.
qwqw
Member

Usergroup: Customer
Joined: Feb 16, 2003

Total Topics: 9
Total Comments: 15
qwqw
Posted Aug 18, 2005 - 12:50 PM:

Thanks.
Any chance to be more specific? I did not understand a thing.

I'm just curious that for 3+ years of wsn links' life no one ever wondered about such a simple thing?

is there any easy way to it?

may it could be one of the features: place categories horisontally or vertically?

I actually managed to place the categories alphabetically vertically by using CATPROIRITY with default template but it is a very time consuming and complecated way. More over you have re-assign the priorities all the time if you add or remove any categories.

There must be an easy way of doing this.

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 18, 2005 - 8:12 PM:

It's a possible future feature, if I decide to get rid of most of the tables and transition everything to <div>s. That wouldn't be until a 4.0 version most likely though. For now you have to know HTML to do it.
ingenious22
Beginner

Usergroup: Customer
Joined: Jul 08, 2007

Total Topics: 0
Total Comments: 3
Posted Jul 10, 2007 - 7:29 AM:

I did this by following the tip in the manual KB. It didn't work...but I used the idea and made a modification/verticalcol.php file:

<?php
function verticalcol($catnumber,$totalcats){
$newcol = 0;
if (($catnumber-1 == (int)($totalcats / 4)) OR ($catnumber-1 == (int)(2* $totalcats / 4)) OR ($catnumber-1 == (int)(3*$totalcats / 4))){
$newcol = 1;
}

return $newcol;
}
?>


and in main.tpl, I removed the tables and put

<IF {FUNC_VERTICALCOL[{CATNUMBER} <,> {TOTALCATS}]}></ul></div><div class="column"><ul></IF>


where I wanted to start a new column (it closes the div an starts a new one, use css float:left on .column to make them side by side).

My question: {TOTALCATS} gives the number of cats in the whole directory, whats the variable for the number of cats being displayed on the page?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 13, 2007 - 7:15 AM:

You're limiting the number of categories per page? You can use
<?php if ({TOTALCATS} > {CATSPERPAGE}) echo {CATSPERPAGE}; else echo {TOTALCATS}; ?>
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.