Skip to main content

#207 Managing the filter[bydate]=custom

Posted in ‘Calendar Filter’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information (available for public)

PHP version
8.2

Latest post by b2z on Thursday, 04 December 2025 08:44 EET

Semaphore

Hello,
We are getting back to you with a new request based on feedback from our users.
We use this URL to display the agenda page by default, supposedly without any filters:
“https://www.mairie-melle.fr/agenda?cfilter=1&filter[bydate]=custom&filter[field]=21&filter[field_order]=asc”
Then users can filter by month on the right.

However, in reality this initial display seems to already filtering on the current month, and users don’t understand why, for example, when they navigate to the second page via the pagination at the bottom (especially now that it works ^^), they are stuck on November.

I explored several hypotheses:
– When they land on this page, it displays a fixed number of items defined somewhere in the settings. I’m not convinced by this option since it will always raise questions about the arbitrary limit.
- Load all the articles/events that will then be paginated.
– A UX approach: clarify what they are seeing by displaying something like “Events in November.” In this case, how should I code this in my template override?

Thanks

b2z

Hi Nicolas,

When the month or year is not passed in the URL then the module code simply assigns the current year and current month.

It won't be possible to display the fixed amount, because the articles query does know anything about the limit defined outside of the category model. At least we want to define on more URL parameter like filter[limit]. But in that case there we need to define how this parameter should behave in case when year, month or day are in the URL. Should it override or nor and so on. Complicated.

UX approach is quite tricky, because you need to override articles blog and as for my undestanding to anylize URL query parameters. Something like this:

$cfilter = Factory::getApplication()->getInput()->get->getInt('cfilter');

if (!empty($cfilter)) {
    $filter = Factory::getApplication()->getInput()->get->get('filter', []);

    if (!empty($filter) && !isset($filter['year']) && !isset($filter['month'])) {
        echo 'Events in November';
    }
}

To load all the articles/events that will then be paginated souns like a good idea, but I am not sure that it is a perfect solutiuon. Not sure about the caldendar behaviour in that case. Also the tricky part is when the month is present in the URL and the year is not present. So it will filter all years within defined month and that will be a messy thing.

Kind regards,

Dmitrijs

Semaphore

If you send me the code for testing the "loading full article with pagination" I could test it and give you some feed back on this real website.

I was thinking, your module do 2 things in fact : sort and filter on a date field. In our current case we only need the "order" functions. 

b2z

Hello!

For J5 or J6?

Kind regards,

Dmitrijs

Semaphore

J5! for some weeks and then J!6 ^^

b2z

Hello!

OK, let me make the changes. Dev version will be sent to you by email in a few days.

Kind regards,

Dmitrijs

System Task
system
The ticket information has been edited by Nicolas OLIVIER (Semaphore).

Semaphore

I have updated the ticket with credentials

b2z

Hello!

1.1.3-dev has been installed. Please test.

Kind regards,

Dmitrijs

Support information

Support hours: You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+3), but not limited. Our staff is pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days.


Our time: / Your time:

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. We also ask you to remove temporary credentials at your site after the problem is resolved. Thank you.

Support of free extensions is not provided on this forum. Please submit your questions or report issues via Github tracker. See link on the product page.