Jump to content

Jan Romero

Members
  • Posts

    672
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Jan Romero

  1. Can you show the selector you use to get the pages that belong to one category? I'm not sure what your problem seems to be exactly. It looks like your content pages have a page field to select one or more categories, in which case you can filter by that field like so, where "categories" is the name of the field and $category is the category, whether it's a page object or an ID: $pages->find("categories~=$category"); If no page belongs to that category, nothing will be shown. You could also filter by the categories' titles like find("categories.title~=$string"). Also, you should probably use $category->url instead of $category->name in your category list.
  2. As a workaround, it’s possible to set Minimum Value to 0.1, since the field is actually an InputfieldFloat. This will allow values of 0 but no negative ones. Edit: as a matter of fact, changing the modules used for Min and Max in InputfieldInteger.module to InputfieldInteger (seems sensible anyway?), makes it work as desired, as far as I can tell. 0 values don’t disappear when set and the validation within templates works fine as well. Maybe this change is all that’s necessary?
  3. I get the same error when I try to $cal->find() a month that has an event spanning into it: Error Cannot break/continue 1 level (line 340 Events that continue beyond the loaded timespan are fine. That line goes as follows, and, judging from the comment, I don't want that functionality anyways, so I commented it out. Now my output looks good, although I'm not very comfortable with messing with the code... // filter out events that started before the requested time // these will be multi-day events that span into the requested time if($from && $a->from < $from) continue; The point in my code that throws the error: $items = $Calendar->find("from=$year-$month-1, to=$year-$month-$numdays, sort=date"); Otherwise everything is going super swell, thanks a lot for ProcessWire!
×
×
  • Create New...