Jump to content

The Selectors again


BFD Calendar
 Share

Recommended Posts

Trying to get a list of events that happened 'today' results in nothing....

I have a number of 'events' pages with day, month and year fields. Getting the information from 'day' and 'month' I want to list them, and show the locations on a map.

$todayday = date("d");
$todaymonth = date("m");
$features = $pages->find("template=bfd_events, bfd_day=$todayday, bfd_month=$todaymonth, sort=bfd_year");
foreach($features as $feature)
echo "<li><a href='{$feature->url}'>{$feature->title} {$feature->bfd_case->title}</a></li>";
    
$items = $pages->find("template=bfd_events, bfd_day=$todayday, bfd_month=$todaymonth, MapMarker!='', sort=title"); 
$map = $modules->get('MarkupGoogleMap'); 
echo $map->render($items, 'MapMarker', array('height' => '400px', 'zoom' => '2', 'lat' => '50.923813', 'lng' => '4.431493')); 

'bfd_day' and 'bfd_month' are Page fields while MapMarker is fetched to 'events' with a 'get("template=bfd_places, id=$page->bfd_events_places_id_list")'.

Using selector 'title*=November' works.

Link to comment
Share on other sites

Ok, I was mistaken by this

Using selector 'title*=November' works.

If bfd_month is a page field bfd_month=11 will search for the page with the id 11.

If 11 is the name of the page you should use bfd_month.name=11 instead.

  • Like 2
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...