Jump to content

Problem with repeater field


sissi voss
 Share

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...