Jump to content
sissi voss

Problem with repeater field

Recommended Posts

Hello everybody,

I'm an absolute beginner with processwire and apologize for my probably stupid question; I've been looking for help in the forum for many hours, but haven't found anything.

Here is my problem:

I have created a page with a repeater field called events.
The repeater field contains a date field "termin"; fieldtype is DatetimeAdvancd. The dates are recorded by the date / time picker.

In the backend I serve two selection fields, month and year, so that one can search for an event that takes place either in a certain month or in a certain year or in a certain month / year combination.

If you select the month and year, it works fine, if there is only 1 date for an event.
If there are several dates for an event, events are also shown that take place either in the selected month or in the selected year, but not in the selected month / year_combinations. Why is it.

The user inputs are processed via switch

switch (true) {
case ($ month! = '...' and $ year! = '...');
$event = $pages-> find ('template = my_template, event.termin.month ='. $ month. ', event.termin.year ='. $ year. ', include = all') -> sort (" event.termin ");
break;
default:
echo 'no hit';
}
...
What am I doing wrong?

sissi

Share this post


Link to post
Share on other sites

Sorry,

of course I ment, that in the frontend I serve two selection fields, month and year, so that one can search for an event that takes place either in a certain month or in a certain year or in a certain month / year combination.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...