Pixelpost Forum

Pixelpost Forum (http://www.pixelpost.org/forum/index.php)
-   Template design and Front-End Code (http://www.pixelpost.org/forum/forumdisplay.php?f=20)
-   -   How to Display Categories Horizontally (http://www.pixelpost.org/forum/showthread.php?t=10156)

kouroshazar 02-04-2009 12:46 AM

How to Display Categories Horizontally
 
I'm not that conversant with CSS or PHP but I've been trying everything to try and figure out a way to display the list of Categories on the Browse page as a horizontal list instead of a vertical list that it defaults to whenever you use the <CATEGORY_LINKS_AS_LIST> tag. I am using version 1.7.1 and modyfying the Simple Template to suit my needs.

I have tried modifying the css files every which way I could but no luck. I read somewhere that I need to edit the categories.php file. I have no idea what to edit in this file. The outcome I want to achieve is:

Category A (12) | Category B (5) | Category C (34) | Category D (9)

Any help would be greatly appreciated.. Much thanks in advance...Kourosh

kouroshazar 02-06-2009 12:42 AM

Please Help!
 
Please Help! Anyboby.... Anyone!

jaywilliams 02-06-2009 04:02 AM

A link to your site showing exactly what you want done might be helpful. :)

kouroshazar 02-06-2009 11:27 PM

My site
 
The way it looks on my site at the moment can be seen here:

http://pixelpost.kouroshazar.com/index.php?x=browse

The way I want it to look can be seen here:

http://www.homeofthevain.com/index.php?x=browse

kouroshazar 02-08-2009 11:28 PM

Somebody please help!

jaywilliams 02-09-2009 01:32 AM

What you need to do is open up the addon paged_archive.php, and do a search for "$category_Link_List". Every time you see $category_Link_List .= "someting...<br />"; remove the <br /> and replace it with a pipe "|" or whatever else you want.

Example:
On line #201, you'll see this.
PHP Code:

$category_Link_List .= "<a href='index.php?x=browse&amp;category=$id'>$catname_count</a><br />"

Change it so it looks like this:
PHP Code:

$category_Link_List .= "<a href='index.php?x=browse&amp;category=$id'>$catname_count</a> |"

Continue to search until all of the "$category_Link_List" items are altered.

kouroshazar 02-09-2009 08:38 PM

Thank you!
 
Jay,

Thank you so much for your help! I really appreciate it!

kouroshazar 02-09-2009 08:50 PM

One last question regarding this.

Your recommendation works like a charm. However, is there a way to not have it put the pipe " | " after the last category? You can see what I mean at:
http://pixelpost.kouroshazar.com/index.php?x=browse

Dkozikowski 02-09-2009 09:00 PM

Quick and easy solution is to use rtrim...

Example,

On line 208 you see this:
PHP Code:

$category_Link_List_paged .= "</ul>"

Right above that on line 207 add this:
PHP Code:

$category_Link_List rtrim($category_Link_List' |'); 


kouroshazar 02-09-2009 09:29 PM

Thanks!
 
Thanks Dkozikowski, it's all good now! :)


All times are GMT. The time now is 04:05 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.