[since v2.0.0] Change default sorting items in backend

More
15 years 9 months ago #6214 by vlester
Hello,

By default, in the backend the items are ordered by date of creation : at the top of the list, the very first items created.
I would like to display at the top the last items created. It can easily be done by clicking on the "created" button to sort the items the way I want but it takes a click everytime and I'm sure there is a way to change the default parameter.
Same thing for the categories list, I would like to get them by alphabetical order.

I looked in the "models" folder but I didn't find how to do it.

That could be very helpful for those who have to manage a lot of categories and items.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #15937 by ViveLeFlexicontent
been at it a few hours trying to get this done myself.. every post I find is unanswered :| ok this one is very old, but still.

I really need Categories and items (backend) by default order asc.. So it's easy to find the category to post the item in.. and so on

Had a look in the database, and there is a orderby= parameter but its empty, and I dont know if I can add something and or what.. Damn google gives me nothing but worthless or spyware infested sites.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #15942 by micker
Did you try the last version 1.5.5 in svn download ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #15946 by ViveLeFlexicontent
heya micker. nope, am a bit scared of updating lol, I changed so much code. got backups though so will do it soon before I go live.

anyhow I fixed it :D in the front end that is..
Categories and subcategories now default order ASC. In /components/com_flexicontent/models/category.php
change on line 404, 506
'ordering ASC';
to:
'c.title ASC';
and in models/flexicontent.php
line 256 also change
'ordering ASC';
to:
'c.title ASC';

But no order in the backend yet. While you can sort the categories by title in the main category view. If you are in a particular item view you have the little select box on the right where you also set the primary category, gonna try to get this by order asc now.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #15950 by micker
Great thanks for this return
Thinks about sharing your modification for community
regards

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17215 by tbunte
Has anyone an idea how to change these backend parameters in FC.
It was not very nice to see always you oldest articles on top, an not the newest one?

best regards,
Thomas

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17240 by ggppdk
Hello, this is a hack, i will rather add an option that suggest hacks to the code, (but now no time to do add options) because when you upgrade your hackes will be overwritten so have a file where you list your changes ALWAYS
In file:
administrator/components/com_flexicontent/models/items.php
In function: _buildContentOrderBy()
at line:
Code:
$filter_order = $mainframe->getUserStateFromRequest( $option.'.items.filter_order', 'filter_order', 'i.ordering', 'cmd' );
replace 'i.ordering' with 'i.created' or 'i.modified'
Code:
$filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.items.filter_order_Dir', 'filter_order_Dir', 'ASC', 'word' );
replace with 'DESC'

Logout and Login to check that it works

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17246 by micker
cool
thanks

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #22088 by pcpros2go
I know this post is a little old but thought I'd add the other half of this code.

ggppdk's hack works like a champ when you're in the Flexicontent items.

The other half of the hack is to match the sorting when you're creating a menu item and selecting your flexicontent item for the menu.

Hack to modify backend sorting in when selecting flexincontent menu item

In file:
administrator/components/com_flexicontent/models/itemelement.php

In function: _buildContentOrderBy()

Look for:
Code:
$orderby = ' ORDER BY '.$filter_order.' '.$filter_order_Dir.', i.ordering';

replace 'i.ordering' with 'i.created' or 'i.modified' which ever one you used in the previous hack.

And the line before the above code should be:
Code:
$filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.itemelement.filter_order_Dir', 'filter_order_Dir', '', 'word' );

In the '' add DESC so it should look like
Code:
$filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.itemelement.filter_order_Dir', 'filter_order_Dir', 'DESC', 'word' );

That should get you the same sorting when selecting a flexicontent item for your menu item as it is when you're looking at your flexicontent items.

PC Pros 2 Go
Computer Repair - Web Design - Hosting

And occasionally I hack up some Joomla code.
www.pcpros2go.com

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #22089 by ggppdk
Hello

In late revisions of v1.5.6 / 2.0,

we have 2 new parameters for this in the FLEXIcontent Component configuration.

- item order
- ordering direction (ASC-ending/DESC-ending)

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save