Recent Topics

1 Nov 30, 2007 12:50    

My b2evolution Version: 1.10.3

Is there any way to re-order my categories so that they display in a different order on my page?

im using v1.10.3 and my website is http://www.bestnewtoys.co.uk
i'd like to have the 'under 5's' category display at the top

apologies if this is a silly question, im new, but ive found quite a few solutions to other problems searching this forum so thought i'd ask.

2 Nov 30, 2007 13:37

I'm pretty sure that categories are in alpha order and there's no easy way to re-order them.

There may be a hack somewhere on the forums but I'm buggered if I can remember where. It went along the lines of :

add 2 digits to the front of your categories so that they end up in the order that you want and then strip out the first 2 characters when spitting their names out.

The main problem with that is there's quite a few places where the category names are spat out.

An alternative, if you don't change your categories often, is to hard code them into your sidebar in the order you want them.

¥

3 Nov 30, 2007 13:46

thanks yabba,

i think i'll go for option 2 as the categories wont be changed that often, apart from a few additions over time.

could you point somewhere that will help me with hard coding these categories. im new to php and need all the help i can get.

4 Nov 30, 2007 13:52

The simplest method is to copy the html that's produced for your categories and then crack open your skins _main.php and replace this section of code with the html ( after changing it so your categories are in the right order )

	<?php
		// -------------------------- CATEGORIES INCLUDED HERE -----------------------------
		// Call the Categories plugin:
		$Plugins->call_by_code( 'evo_Cats', array(	// Add parameters below:
			) );
		// -------------------------------- END OF CATEGORIES ----------------------------------
	?>

¥

5 Nov 30, 2007 13:54

Hi smommer,

That's the easy part, just copy from the source code:

<div class="bSideItem"><h3>Categories</h3><!--<a href="http://bestnewtoys.co.uk/index.php?blog=1">Best New Toys</a>--><ul><li><a href="http://bestnewtoys.co.uk/index.php?blog=1&amp;cat=21">11 to 15 Years</a> <span class="notes">(0)</span></li>
<li><a href="http://bestnewtoys.co.uk/index.php?blog=1&amp;cat=20">5 to 10 Years</a> <span class="notes">(0)</span></li>
<li><a href="http://bestnewtoys.co.uk/index.php?blog=1&amp;cat=22">Educational</a> <span class="notes">(0)</span></li>
<li><a href="http://bestnewtoys.co.uk/index.php?blog=1&amp;cat=19">Under 5s</a> <span class="notes">(2)</span></li>

</ul>

</div>


I think you should drop the <span class="notes">(0)</span> things, since they don't get upgraded.

So, make your alterations in this code and place it in SKIN/_main.php where the categories are now.

Good luck

6 Nov 30, 2007 13:57

Thanks for your help afwas

i'll give this a try. I really appreciate the help, cheers

edit: this worked great thanks guys :)

7 Nov 30, 2007 13:59

Darn ¥åßßå nearly always beats me on speed. But this time our posts are fully complementairy. :p


Form is loading...