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

More
12 years 9 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...

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

More
12 years 9 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
12 years 3 months 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
12 years 3 months 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...

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

More
9 years 7 months ago #50137 by meteo
Hello into this thread

I searched like a dog to solve this "problem" for me.
I tried to change the sorting in the "Configuration" in the item-view.

My wish: Sorting by ID's, highest number at the top.

I try and search and try and search....... nothing works.

Which tab I have to use and which parameter I have to change?

Thanks

MArkus

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

More
9 years 7 months ago #50145 by micker
sorry in backend or front end ?
for front => modify category ordering
for backend => not possible

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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.281 seconds
Save
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