Vox Populi(x) forum

Alexandria Book Library => Supporto (Support) => Topic started by: k.rasheva on 20 September 2020, 00:51:52

Title: Book Search Issue (Search results sorted by year)
Post by: k.rasheva on 20 September 2020, 00:51:52
Hello Federica and Dario!
I have recently started using Alexandria book library on my website.  It is an excellent library extension and I have enjoyed creating a library with it.
The only issue I am having is when I use the search menu. I made a "Search" menu item and it works fine in alphabetical mode. I need it open results ordered by the year of the Books. When I make these settings from the menu I see server error 500 or if it works the books are sorted alphabetically. Can you tell me where I have made wrong?

Thank you in advance!
Best regards!
Katia
Title: Re: Book Search Issue (Search results sorted by year)
Post by: federica on 27 September 2020, 10:50:00
Hi Katia,
search by year is based on field "Year" (year of publication), not by "Date insert". Have you filled in "year" field?

If you like Abook, please add a review on "joomla extension directory" https://extensions.joomla.org/extension/alexandria-book-library/ . i will appreciate it very much. Your review will helps other people!
Title: Re: Book Search Issue (Search results sorted by year)
Post by: k.rasheva on 29 September 2020, 13:21:35
Quote from: federica on 27 September 2020, 10:50:00
Hi Katia,
search by year is based on field "Year" (year of publication), not by "Date insert". Have you filled in "year" field?

If you like Abook, please add a review on "joomla extension directory" https://extensions.joomla.org/extension/alexandria-book-library/ . i will appreciate it very much. Your review will helps other people!

I actually created a "Search" button. I would like the books in Search View (and everywhere) to be sorted by "year" without having to use filters. They have currently sorted/ordered alphabetically, not by year. How to make that... Thank you for your support. Best regards! Katia
Title: Re: Book Search Issue (Search results sorted by year)
Post by: federica on 30 September 2020, 21:57:02
Go to Abook global Options -> categories then set "Books order"=year
Title: Re: Book Search Issue (Search results sorted by year)
Post by: k.rasheva on 01 October 2020, 07:55:59
Quote from: federica on 30 September 2020, 21:57:02
Go to Abook global Options -> categories then set "Books order"=year

Thank you for your reply, Federica!
I made this setting before writing to you. I have no idea why this setting is not working on my site. The books are still ordered by name alphabetically. I have books which titles are in Cyrillic, and English titled books. In the Search page,  English books are presented first, then are Cyrillic books, and all of the books are presented alphabetical order... I still don't understand where am I wrong. (Sorry for my English).
Title: Re: Book Search Issue (Search results sorted by year)
Post by: k.rasheva on 22 October 2020, 23:31:47
Quote from: federica on 30 September 2020, 21:57:02
Go to Abook global Options -> categories then set "Books order"=year

Unfortunately, this setting does not work on my site. I tried everything - the order of the books is always in alphabetical order from A to Z. I even tried to put the year (which is very important to me) as the starting word of the title - the books are arranged by year (ie by numbers in title), but in the reverse order of what I need (from oldest to newest - for example from 2013 to 2020).

I don't know how to make the library sort the books the way I set it in the settings. I even tried to reinstall the component - nothing changed. What can affect the component? Thank you!
Title: Re: Book Search Issue (Search results sorted by year)
Post by: k.rasheva on 23 October 2020, 00:35:07
I found the decision in the forum:
...components/com_abook/models/search.php, line 250:
Code: [Select]
// $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC')).', a.title');
// commented out and for instance new:
$query->order($db->escape('a.year DESC'));
$query->order($db->escape('a.pag_index'));
This works! Thanks!