normal Ordering of articles

More
12 years 2 months ago #301 by thellie root
Is it possible to adapt so that the articles are in alphabetical order, or preferably, ordered according to their order set in the back-end?

My articles in the minitab are such that I would like an overview article to always sit at the top of the list on each tab.

thanks :)

btw Joomla 1.7
The following user(s) said Thank You: makcim makcimov

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

More
12 years 2 months ago #302 by Linh Robert

thellie wrote: Is it possible to adapt so that the articles are in alphabetical order, or preferably, ordered according to their order set in the back-end?

My articles in the minitab are such that I would like an overview article to always sit at the top of the list on each tab.

thanks :)

btw Joomla 1.7


Hi thellie,
In the back-end, at this module edit page, there is parameters area at the right side. You'll find the "order by" options.

Thanks for using our products!

If you need to send us FTP access / host access, administrator access or any private information:
services(at)omegatheme(dot)com or drop a ticket www.omegatheme.com/member/
The following user(s) said Thank You: makcim makcimov

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

More
12 years 2 months ago #305 by thellie root
Yes, I have seen them already, but the order options are limited to ones related to 'Recently...' and 'Most hits..'

I would like one based on the parameters I mentioned, but these options are not available.

Which files would I need to hack to add these options myself? I'm fairly comfortable in PHP and MySQL, so am not worried about giving it a go.
The following user(s) said Thank You: makcim makcimov

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

More
12 years 2 months ago - 12 years 2 months ago #306 by Linh Robert

thellie wrote: Yes, I have seen them already, but the order options are limited to ones related to 'Recently...' and 'Most hits..'

I would like one based on the parameters I mentioned, but these options are not available.

Which files would I need to hack to add these options myself? I'm fairly comfortable in PHP and MySQL, so am not worried about giving it a go.


Hi,
Great to hear that! You can find the file named "helper.php" in "modules/mod_otminitabs/".

Goodluck and thanks for using our products!

If you need to send us FTP access / host access, administrator access or any private information:
services(at)omegatheme(dot)com or drop a ticket www.omegatheme.com/member/
Last edit: 12 years 2 months ago by Linh Robert.
The following user(s) said Thank You: makcim makcimov

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

More
12 years 2 months ago #309 by thellie root
Ok, thanks.

Below is the amended code, but I had to manually change the ordering parameter in the #_modules table, to the new option (o_asc), as I couldn't work out where the MySQL table is updated. I also added the option to the en-GB files in the language folder, but as the MySQL update doesn't work, this is currently redundant.
Code:
// Set ordering $order_map = array( 'm_dsc' => 'a.modified DESC, a.created', 'mc_dsc' => 'CASE WHEN (a.modified = '.$db->quote($db->getNullDate()).') THEN a.created ELSE a.modified END', 'c_dsc' => 'a.created', 'p_dsc' => 'a.publish_up', 'h_dsc' => 'a.hits', 'o_asc' => 'a.ordering' ); $ordering = JArrayHelper::getValue($order_map, $params->get('ordering'), 'a.publish_up'); IF($order_map='o_asc') {$dir = 'ASC';} ELSE {$dir = 'DESC';} $model->setState('list.ordering', $ordering); $model->setState('list.direction', $dir);
The following user(s) said Thank You: makcim makcimov

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

More
12 years 6 days ago #857 by Morten Lysgaard
Hi

I have tried to change my code to

// Set ordering
$order_map = array(
'm_dsc' => 'a.modified DESC, a.created',
'mc_dsc' => 'CASE WHEN (a.modified = '.$db->quote($db->getNullDate()).') THEN a.created ELSE a.modified END',
'c_dsc' => 'a.created',
'p_dsc' => 'a.publish_up',
);
$ordering = JArrayHelper::getValue($order_map, $params->get('ordering'), 'a.publish_up');
IF($order_map='p_dsc') {$dir = 'ASC';} ELSE {$dir = 'DESC';}

But the ELSE function doesn't seem to work....


Best regards
Morten
The following user(s) said Thank You: makcim makcimov

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

Time to create page: 0.249 seconds

About Growth

Innovative tech for eCommerce growth

Contact Info

Head: No. 3, 175/55 Lane, Lac Long Quan St., Nghia Do Ward, Cau Giay District, Hanoi City, Vietnam