Search events module - sort categories manually?

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
3 months 1 day ago - 3 months 1 day ago #113238 by Philipp
Hi there,

I use the "Search events" module on my timeline view, and it is critical to my customer. Is there a way to manually sort the entries as they appear in the dropdown list, esp. the categories? The current order is desc alphabetically by category name, which is a good default but how I would want to rank them.

Many thanks, as always, Philipp
Last edit: 3 months 1 day ago by Philipp.

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

More
3 months 18 hours ago #113249 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Search events module - sort categories manually?
Hi Philipp

Could you please send me the link to that page on your site? I want to take a look at it to know exactly what page are being used and give you the correct answer

Regards,

Tuan

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

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
3 months 13 hours ago #113275 by Philipp
Hi Tuan,

absolutely, here it is: ifqh.de/termine

It's the middle one called "Seminartypen" in my translation, that is the categories of events. Note that sorting by id would not do in my case, as this is also not the order I seek.

Many thanks, Philipp

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

More
2 months 4 weeks ago #113311 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Search events module - sort categories manually?
Hi

It's ordered by name at the moment. I think ordered by name will make it easier for user to find the category they want

If you want to change it, I think you can change it to ordering. Look at modules/mod_eb_search/mod_eb_search.php, find this block of code:
$query->select('id, parent AS parent_id')
	->select($db->quoteName('name' . $fieldSuffix, 'title'))
	->from('#__eb_categories')
	->where('published = 1')
	->where('`access` IN (' . implode(',', JFactory::getUser()->getAuthorisedViewLevels()) . ')')
	->order('name');

Change it to:
$query->select('id, parent AS parent_id')
	->select($db->quoteName('name' . $fieldSuffix, 'title'))
	->from('#__eb_categories')
	->where('published = 1')
	->where('`access` IN (' . implode(',', JFactory::getUser()->getAuthorisedViewLevels()) . ')')
	->order('ordering');

And then you can go to Events Booking -> Categories, order the categories to the order you want

Regards,

Tuan

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

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 months 4 weeks ago #113325 by Philipp
Hi Tuan,

great, works perfectly, many thanks. As I said, ordering by name makes for a good default, but when you have two categories that make up about 80% of your events, and some once-a-year outliers, you want those categories to be at the top. Or it's just me...

Last follow-up: do I need an override file, or is this edit update-stable?

Many thanks, Philipp

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

More
2 months 4 weeks ago #113328 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Search events module - sort categories manually?
Unfortunately, that code could not be override. We can only override the layout file in module, not the code

You can get this file, unzip it, upload to PATH_TO_TEMPLATE/html/mod_eb_search and it should work in the same way, plus, it won't be lost when you update to future releases of the extension

Regards,

Tuan
Attachments:

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

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 months 4 weeks ago #113331 by Philipp
Excellent: many thanks!

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

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 months 3 weeks ago #113617 by Philipp
Hi Tuan,

the recent update to 3.5.1 did indeed kill our little override, despite the default.php in PATH_TO_TEMPLATE/html/mod_eb_search. Any idea what went wrong, and how to get an update-proof solution for this?

Many thanks, Philipp

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

More
2 months 3 weeks ago #113636 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Search events module - sort categories manually?
Hi Philipp

I have no clue about why it's being lost. You need to replace PATH_TO_TEMPLATE with the actual path of your site template

If you want, submit a support ticket sending us super admin account of the site and link to the page which the module is being displayed

I will check to see what's wrong and correct it for you

Regards,

Tuan

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

  • Philipp
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 months 3 weeks ago #113637 by Philipp
Hey Tuan,

don't worry, I recognize a variable when I see one: The file was placed under /html/mod_eb_search in my current template path :)

I' send you the data via ticket. Many thanks!

Philipp

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

Moderators: Tuan Pham Ngoc