× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Filter Joomla article by year

More
7 years 1 month ago #4350 by cb75ter
Filter Joomla article by year was created by cb75ter
Hello,

I already display a list of joomla article from a external DB.
Thank to a dropdownlist, I would need to filter this list by the article's year of publication (field 'publish_up' from com_content table).

- As options, the dropdownlist would fetch the years for which at least one article has been published.
- When a year is selected, corresponding article would be displayed.

Is it possible with Pro Version knowing that the date stored in publish_up field looks like "2017-02-07 13:44:20" ?

Thank in advance for your answer

Please Log in to join the conversation.

More
7 years 1 month ago #4351 by Dirk
Replied by Dirk on topic Filter Joomla article by year

cb75ter wrote: Is it possible with Pro Version knowing that the date stored in publish_up field looks like "2017-02-07 13:44:20"


With the free version you could use the sql-where menu option of your catalog.
Just enter "publish_up LIKE '2017%';

If you use the free version and you want to select custom years like the category selector on db example on this site you need to insert a manual select field into the head of your catalog template.
<select class="inputbox groupselect" id="gs_year" name="gs[publish_up][]" onchange="submitSearch('')">
<option value="">All...</option>
<option value="2017%">2017</option>
<option value="2018%">2018</option>
<option value="2019%">2019</option>
</select>

cb75ter wrote: - When a year is selected, corresponding article would be displayed.


Article oder article(s)?

With the pro version you could use a plugin to insert a year selector or the
searchfield command.

documentation.html?search=Searchfield

Please Log in to join the conversation.

Moderators: Dirkjoest