Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 40

Newest Member: Xoote


Old 13.07.2004, 17:09   #1
charlener
Baby Mamber
 
Join Date: Jul 2004
Posts: 17
charlener is on a distinguished road
Default Ordering Sections and Categories

Perhaps I'm mistaken, but I'm completely confused as to why this doesn't work...

So in the admin panel, both Sections and Categories have this nice reorder button. Reordering also seems to be present in the dropdown box when you edit individual Sections and Categories. In the panel, all these elements are ordered in the way in which I'd like them to display on the site. (I'm using a Sections menu)

However, while everything looks dandy on the backend, on the frontend the categories and sections are ordered seemingly randomly to me -- the orders I specify in the backend seem to not apply.

Am I doing something wrong? This is with a clean install of Mambo that dropped all previously existing tables on install.


I figured out that Sections cannot be deleted until all its Categories are deleted, at least...

Also, this seems to be already posted but also not replied to...

other thread

Last edited by charlener; 13.07.2004 at 19:10.
charlener is offline  
Sponsored Links
Old 13.07.2004, 20:07   #2
reikimaster
Mamber
 
reikimaster's Avatar
 
Join Date: Apr 2004
Posts: 60
reikimaster is on a distinguished road
Default Re: Ordering Sections and Categories

Are you talking about how they're ordered on the frontpage?

Like... you order them administratively but when you go to the FrontPage they're not ordered (except in the lists if you go to a certain section).

If so... I've asked this too.... right about the time I saw in the administrative back-end ... Component -> FrontPage.
reikimaster is offline  
Old 13.07.2004, 20:34   #3
charlener
Baby Mamber
 
Join Date: Jul 2004
Posts: 17
charlener is on a distinguished road
Default Re: Ordering Sections and Categories

Yes, that's it. And also, when you click on one of the sections from the frontpage, it displays all the categories, but not necessarily in the order in which they're set from the backend.

Did you ever get a response concerning it?
charlener is offline  
Old 13.07.2004, 21:49   #4
reikimaster
Mamber
 
reikimaster's Avatar
 
Join Date: Apr 2004
Posts: 60
reikimaster is on a distinguished road
Default Re: Ordering Sections and Categories

Here's what I learned...

When you order Categories within a Section (from the administrative backside) they show up in that order when you click on that Section from the main menu.

For example if you have a NEWS section and it has Categories called Category 1, Category 2, Category 3, AND if you order them as 1, 2, 3 in the administrative backend, THEN if you go to your Front Page and click on NEWS in the main menu you should get a page that lists the Categories as 1, 2, 3.
If you administratively REorder them as 3, 2, 1 then they should show up that way when listed from the NEWS link on your main menu.

HOWEVER....
On the home page you have to use that Component -> Front Page administration tool for ordering. And THEN you're ordering ITEMS within categories. It was a bit confusing to me when I was having trouble, but it's because I didn't even understand the whole Section -> Category -> Item hierarchy. Once I got a handle on that AND rediscovered the Front Page component.... well... I can tell you that now I look less stupid than I did earlier

reikimaster is offline  
Old 13.07.2004, 21:57   #5
charlener
Baby Mamber
 
Join Date: Jul 2004
Posts: 17
charlener is on a distinguished road
Default Re: Ordering Sections and Categories

Thanks for the reply...I *think* I understand the whole hierarchy thing, but I think I led you a bit down the wrong path...when you said front page, I was thinking literally front page, not the front page component. In essence, the part I'm having trouble with is actually the Sections module -- um, here's the website: http://www.nclyn.org

And the issue specifically would be under Sections after About Us should be What We Offer, and that's the way it's ordered in the backend, but it doesn't show up this way -- and there aren't any config things associated with the Sections module about ordering as far as I can tell. In addition, if you click on the About Us link in the Sections, it gives Sources of Income before About NCLYN, when in the backend it's the other way around.

Um, any insights from that?
charlener is offline  
Old 14.07.2004, 03:18   #6
reikimaster
Mamber
 
reikimaster's Avatar
 
Join Date: Apr 2004
Posts: 60
reikimaster is on a distinguished road
Default Re: Ordering Sections and Categories

Ok I got it now.

open modules/mod_sections.php in an editor

At line 28 (or very close .... I have not edited my mod_sections.php before this) ...
you should see a line that says:

Code:
. "\nORDER BY title ASC"
Change it to read:

Code:
. "\nORDER BY ordering ASC"
and yes there's a dot at the beginning of the line. You really only have to change the word "title" to "ordering"

That should make your sections display on the sidebar the way you have them set in the ordering in the admin backend. I'll look at how they display when you open a particular section and get back to you here...
reikimaster is offline  
Old 14.07.2004, 03:45   #7
reikimaster
Mamber
 
reikimaster's Avatar
 
Join Date: Apr 2004
Posts: 60
reikimaster is on a distinguished road
Default Re: Ordering Sections and Categories

Ok, when I click on About Us in your sidebar of Sections,
I see:

Mission Statement
Sources of Income
About NCLYN

These are ITEMS but are they all in the same CATEGORY?

If they are all in the same category then:
Open components/com_content/content.php
Go to line 199
You should see this:

Code:
	// get the list of items for this category
	$database->setQuery( "SELECT c.id, c.title, c.hits, c.created_by, c.created_by_alias,"
		. "\n	c.created AS created, c.access, u.name AS author, c.state"
		. "\nFROM #__content AS c"
		. "\nLEFT JOIN #__users AS u ON u.id = c.created_by"
		. "\nWHERE c.catid='$category->id' $xwhere"
		. ($noauth ? "\n	AND c.access<='$gid'" : "" )
		. "\nAND '$category->access'<='$gid'"
		. "\nORDER BY c.ordering"
		. "\nLIMIT $limitstart, $limit"
(that's line 199 to 108)

See where it says ORDER BY ?
c.ordering is what it should say if you want to use the ordering.



NOT meaning to confuse... so if they're all items inside the same category of the section you don't need to read the next part.

NOW.... if these items are in different CATEGORIES within the SECTION, then I think what you're seeing is something like:
SECTION
CATEGORY1
ITEM1
ITEM2
ITEM3
CATEGORY2
ITEM1
ITEM2
ITEM3
...and so on. In other words it will take the first CATEGORY in the order and display I think up to 3 ITEMS within that first category, then move on to the next category in the order and display up to 3 items from THAT category.....and so on. I'm not EXACTLY sure on whether it stops at 3 per category because my site is new and I don't have enough items to test that.
reikimaster is offline  
Old 14.07.2004, 14:27   #8
charlener
Baby Mamber
 
Join Date: Jul 2004
Posts: 17
charlener is on a distinguished road
Default Re: Ordering Sections and Categories

You are SO my hero concerning the first issue - it seems very happy and works mucho props...

as far as the second thing...the items *are* all in different categories...here's a screenshot of the admin end of things:



I noticed, tho, that from the sections module, the link generated is this: http://nclyn.org/index.php?option=co...ogsection&id=2

Since it refers to blogsection, could a similar edit be used to affect ordering?
charlener is offline  
Old 14.07.2004, 15:14   #9
reikimaster
Mamber
 
reikimaster's Avatar
 
Join Date: Apr 2004
Posts: 60
reikimaster is on a distinguished road
Default Re: Ordering Sections and Categories

Look again into that components/com_content/content.php file.

Search for "ORDER BY" (without the quotes)

You'll probably find LOTS of instances of it. However the ones you're interested are most likely going to be found in like... the first 5 instances or so. When you see the ones that have several parameters after the ORDER BY those are for things like polls and stuff so you probably shouldn't edit those for now.

This content.php file appears to control how content is displayed. It's really quite interesting the number of things in that file, but doing a search on ORDER BY should show you what you need. Read the comments for the sections in which you find those words. Like where you see in my paste of code in previous post here where it said:

Code:
// get the list of items for this category
I'm at work and not accessing the file right now so can't give you a specific place in the file, but, again, doing that search should get you what you want. If you see ORDER BY title or ORDER BY c.title or something to that effect then you know you want to change it. (If it says "title" change it to "ordering", if it says "c.title" then change it to "c.ordering"... just follow the format that exists in the line you're changing and you should be fine).

PLEASE PLEASE PLEASE keep a backup of any files before you change them so you don't come back and holler at me later if something doesn't do what you expected.

These are pretty safe edits. Just do things one at a time and test and you should be in good shape.
reikimaster is offline  
Old 14.07.2004, 16:32   #10
charlener
Baby Mamber
 
Join Date: Jul 2004
Posts: 17
charlener is on a distinguished road
Default Re: Ordering Sections and Categories

So I think I finally fixed it...if you change content.php line 254 to
. "\nORDER BY a.ordering, a.sectionid, a.catid ASC"

it works IF you have content with order numbers -- I did a Very Bad Thing and looked at the mos_content table with phpmyadmin, and saw that all the items had 1 as their ordering, so I physcially edited that in database, and now everything is the way I want it...far as I know, there's no way to order items independent of categories but in this way...it'll be a hassle, I suspect, overall...
charlener is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content > Posting + Categories danews Module 'How Do I' Questions 9 26.08.2004 08:46
Show Categories on Homepage Layout cozimek Mambo 4.5 'How Do I' Questions 2 29.07.2004 13:37
Front end registration -All Sections access?? Author access?? hmercado Mambo 4.5 'How Do I' Questions 2 29.06.2004 18:50
menu: sections und categories padee Mambo 4.5 Allgemein 0 30.04.2004 10:57


All times are GMT +2. The time now is 13:21.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.