close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Change Category Order

Thread began 9/23/2009 8:37 am by denise234045 | Last modified 9/25/2009 11:02 am by Jimmy Wu | 3503 views | 10 replies |

denise234045

Change Category Order

I need to change the order of the category items as they appear in the drop down menu - I'm adding categories and don't want them to appear at the bottom of the list.

Thanks!

Sign in to reply to this post

Jimmy Wu

You can order the items by descending order, so the categories will be sorted by newest at the top and oldest at the bottom. To do this, go to your menu.php page in the CSSMenuWriter/cssmw_home/ directory within your powerstore and find the MySql query that looks like this:
"SELECT CategoryName, CategoryID FROM productcategories"

Change it to look like this:
"SELECT CategoryName, CategoryID FROM productcategories ORDER BY CategoryID DESC"

Sign in to reply to this post

denise234045

category order

That's not what I need .... I need to insert a couple of categories within an existing list. Please don't tell me I need to redo and loose what I've already entered into the db....

Sign in to reply to this post

Jimmy Wu

If you modify the query that way, any new categories added will be at the top. You will not lose any of the category data, this just causes the results to be ordered when they are being retrieved from the database. If you want to put the categories into a specific order, this will take considerably more work than modifying the categories to show up.

Sign in to reply to this post

denise234045

Yes - I want to put them in a SPECIFIC ORDER without having to redo it all. I h=guess if I have to I will, but its a considerable amount of work. I'd rather know how to deal with this for future maintenance.

I'm not a php or mySQL expert - wondering if I can make change through phpmy admin - or does the query go by the time stamp??

I guess in the future I should add some empty categories between things - in case I need to more/different categories in the future....

Sign in to reply to this post

denise234045

Okay - I changed the CategoryID's in mySQL, so if I can get them to display in ascending order, it would be great.

I'm assuming that this bit from menu.php is what needs to be changed?

<li class="parent"><span><a href="<?php echo($assumedRoot); ?>Products_Results.php">Products</a></span>
<?php
mysql_select_db($database_localhost, $localhost);
$query_menuwriter_productcategories = "SELECT CategoryName, CategoryID FROM productcategories";
$menuwriter_productcategories = mysql_query($query_menuwriter_productcategories, $localhost) or die(mysql_error());
$row_menuwriter_productcategories = mysql_fetch_assoc($menuwriter_productcategories);
$totalRows_menuwriter_productcategories = mysql_num_rows($menuwriter_productcategories);
?>


Thank you for our help.

Sign in to reply to this post

Jimmy Wu

Yes, that is where you would change the categories to show in ascending order. Change this:
SELECT CategoryName, CategoryID FROM productcategories

to:
SELECT CategoryName, CategoryID FROM productcategories ORDER BY CategoryID ASC

Sign in to reply to this post

denise234045

Thank you!! I so appreciate your help - learning PHP is on my "To do" list...

Sign in to reply to this post

denise234045

Another Related Question

Sorry - now I'm trying to change intermediate.php so the the CategoryID list in ascending order and not having any luck. Again assuming its this snippet that needs to be changed:

SELECT * FROM productcategories WHERE CategoryID = (SELECT ProductCategoryID FROM products WHERE ProductCategoryID = CategoryID AND ProductLive <> 0 LIMIT 1)

I tried adding ASC in various places - no luck.

Thank you - very appreciative.....

Sign in to reply to this post

denise234045

Nevermind!

Figured it out....

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...