Change order ASC or DESC - Move not working

  • mike
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 10 months ago #33003 by mike
Hi,

I want to order the category list from old to new, currently the newest is on top, but it needs to be changed (oldest first), how can i do this ?

Also, if I set the "ordering events by" to ordering it changes the order, but in the backend I cannot change the order in the events list.
the system does not allow me to change the number or even the "move up/down/ does not work.

You have a solution for my problem ?

thanks mike.

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

More
10 years 10 months ago #33059 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Change order ASC or DESC - Move not working
Hi Mike

Go to the events/categories list page in the back-end, click on the header of ordering column. After that, you can change the order of these items !

Regards,

Tuan

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

  • mike
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 10 months ago #33065 by mike
Hi Tuan,

this indeed solves one of the problems.
but would there be a way to have the events sorted by date and then choose asc / desc ??
or is there a simple code change to do this ?

thanks,

Mike.

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

More
10 years 10 months ago #33091 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Change order ASC or DESC - Move not working
Hi Mike

In the current version, it is not possible for users to choose asc/desc. If you want, you can edit the code. Look at the file components/com_eventbooking/models/category.php, find the code below :
Code:
function _buildContentOrderBy() { $orderEvents = EventBookingHelper::getConfigValue('order_events'); if ($orderEvents == 2) { $orderby = ' ORDER BY a.event_date '; } else { $orderby = ' ORDER BY a.ordering '; } return $orderby; }

Change it to :

function _buildContentOrderBy()
{
$orderby = ' ORDER BY a.event_date DESC';
return $orderby;
}

After that, events will be ordered by DATE DESC .

Hope this give you alitle help !

Tuan

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

More
10 years 7 months ago #36886 by TomArtur
Hi Tuan,

this doesn´t work with 1.6.2.

Is there another way with this version?

Best regards

Tom

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

More
10 years 7 months ago #36918 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Change order ASC or DESC - Move not working
Hi Tom

In version 1.6.2, the code has been changed. Please follow the instructions below :

1. Open the file components/com_eventbooking/models/category.php

2. Find the code below:
Code:
if ($orderEvents == 2) { $this->state->set('filter_order', 'tbl.event_date'); } else { $this->state->set('filter_order', 'tbl.ordering'); }

Change it to :
Code:
$this->state->set('filter_order', 'tbl.event_date'); $this->state->set('filter_order_Dir', 'DESC');

After that, it should work as expected.

Tuan

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

More
10 years 7 months ago #36921 by TomArtur
Thanks Tuan,

works like a charm ;)

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

More
10 years 7 months ago #36922 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Change order ASC or DESC - Move not working
Oh Yes. I know that :).

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

Moderators: Tuan Pham Ngoc