WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Vertical alphabetical category listing

Version: 3.23
printPrint


Vertical alphabetical category listing
qwqw
Member

Usergroup: Customer
Joined: Feb 16, 2003
Total Topics: 7
Total Posts: 12
Posted 08/13/05 - 01:11 PM:
quote post
#1
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


Edited by qwqw on 08/13/05 - 03:29 PM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6312
Posted 08/14/05 - 03:34 AM:
quote post
#2
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.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
qwqw
Member

Usergroup: Customer
Joined: Feb 16, 2003
Total Topics: 7
Total Posts: 12
Posted 08/18/05 - 11:50 AM:
quote post
#3
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.



Edited by qwqw on 08/18/05 - 12:16 PM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6312
Posted 08/18/05 - 07:12 PM:
quote post
#4
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.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
ingenious22
Beginner

Usergroup: Customer
Joined: Jul 08, 2007
Total Topics: 0
Total Posts: 3
Posted 07/10/07 - 06:29 AM:
quote post
#5
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6312
Posted 07/13/07 - 06:15 AM:
quote post
#6
You're limiting the number of categories per page? You can use
<?php if ({TOTALCATS} > {CATSPERPAGE}) echo {CATSPERPAGE}; else echo {TOTALCATS}; ?>

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.