Jump to content

BFD Calendar

Members
  • Posts

    412
  • Joined

  • Last visited

Everything posted by BFD Calendar

  1. Happiness comes from small things Now find a Good Samaritan who solves the GoogleMaps problem....
  2. $todaymonth is 11 indeed. That's what it should be because in my 'bfd_month' pagefield I selected '11' for events happening in november.
  3. 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.
  4. For some reason the only array item working here is the height.... echo $map->render($items, 'MapMarker', array('height' => '400px', 'zoom' => '15', 'lat' => '50.923813', 'lng' => '4.431493'));
  5. All that is done. Perhaps I can make you a temp admin so you can add an entry and try to figure out what happens?
  6. Enter address 'city, state, country' in the MapMarker address field. Clicking outside and Lat, Lng and map appear. Upon publish the page is accepted without an error but the MapMarker address, Lat, Lng and map are empty. Entering address again and save publishes successfully.
  7. Trial and error. There was a conflict between two googleapis scripts 'maps/api/js' and 'maps/api/js?v=3'. Seems to work on first geocoding now. Edit: The error is back.... Enter 'Leipzig, Sachsen, Germany' in the MapMarker address field. Lat and Lng appear automatically when clicking outside address field and the map is rendered correct. On clicking 'publish' I get: Added page /selectlists/cities/leipzig/ Added page /selectlists/states/sachsen/ Saved Page: /places/leipzig-sachsen-germany/ (4 changes) - Cannot be published until errors are corrected Error geocoding address The MapMarker field, Lat and Lng entries and map have disappeared. I re-enter 'Leipzig, Sachsen, Germany', click outside address field and everything appears again. On 'publish' I get 'Error geocoding address' again but now the MapMarker field entry is still there while Lat and Lng are zero and the map doesn't show. Below the map it says 'over query limit'. Clicking in and out MapMarker field and publish again finally renders the map. head_inc has <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery-1.9.1.min.js?>"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/main.js?>"></script> <script type="text/javascript" src="<?php echo $config->urls->modules?>FieldtypeMapMarker/InputfieldMapMarker.js?v=203?>"></script> <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?&sensor=false'></script> Using Firefox 24.0 on OSX 10.8.5 - ProcessWire 2.3 - MapMarker 2.0.3
  8. I have that working fine for 'related events' on the individual 'people' and 'places' pages. Thank you. What I was actually referring to is the search box. If you enter 'ballard' in the search box it only returns the 'people' page for ballard, not the events pages related to ballard. On the 'events' page the names are called from the 'people' page by referring id. $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id_list"); Would a Concat field offer some kind of solution? But I guess you can't do that with fields from one template on another.
  9. When everything fails, in the end trial and error always works....
  10. Thanks, I found out about that and made a 'simple' list for now. With a little bit of exercise, or by trial and error for that matter, I hope to putter some more complex find navigation list together sometime soon.
  11. Operator '~=' is not implemented in (in /homez.183/birthfac/www/bfd_processwire/wire/modules/Fieldtype/FieldtypePage.module line 377) How about a simple "=", it works for now....
  12. Cool, got it working now. Dumbfounded why it didn't before. ProcessWire is pleasing me a little bit more every day!
  13. As you can see in the php code from the 'event' template the 'people' and 'places' information is not stored there but called from the 'people' and 'places' templates respectively. $pages->get("template=bfd_people, id=$page->bfd_events_people_id"); In the example above "ballard" is only in the 'title' and 'bfd_people_name_last' fields of the 'people' template, and "london" is only in the 'title' and 'bfd_places_city' fields of the 'places' template. They only meet in the 'event' template when their 'id' matches. A basic relational database situation I would say.... In a relational database the 'event' would be a calculation field, with values calculated 'on demand' only, but still searchable. I wonder if this is possible in ProcessWire.
  14. Example: http://www.birthfactdeathcalendar.net/bfd_processwire/search/?q=ballard returns only one page, from the category 'people'. However, in the category 'Events' there are three pages that also refer to 'ballard' (they are listed as related events on the individual 'people' pages). In the 'event' template the names are called from the pages in the 'people' category by matching the page id: <?php $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id"); $occupation = ucfirst($namepage->bfd_people_occupation->title); if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; echo "<b><a href='{$namepage->url}'>{$occupation} {$namepage->bfd_people_name_first} {$namepage->bfd_people_name_middle} {$namepage->bfd_people_name_last}{$originally}{$alias} </a></b>"; ?> Is there a way to also find the three 'events' from the search box? More complex: http://www.birthfactdeathcalendar.net/bfd_processwire/search/?q=ballard+london shows no results. While there is an event about Ballard in London: http://www.birthfactdeathcalendar.net/bfd_processwire/events/3-april-1970/.... (Sorry for the quirky design, I want to have the site structure working first.)
  15. Since I started a complete new install of PW it shows up all well now. I guess my FTP application was the culprit.
  16. Nevertheless I have another bothersome issue.... When I add a page with a MapMarker field I need three saves before it actually saves. When I input 'city, state, country' in the MapMarker field and click outside it, the Latitude, Longitude and Zoom fields and the map all appear. Upon save there's a geocode error and the page could not be saved. The MapMarker field is empty. When I enter 'city, state, country' again, it saves without error but without Latitude, Longitude, Zoom and map. Then the MapMarker field remembers the 'city, state, country' info. Only upon a third save (and clicking in and out of the MapMarker field once more) it saves with all info in the right fields and rendered map.
  17. Thanks. It was indeed an old version of FieldtypeMapMarker which I presumed would update as well while updating MarkupGoogleMap.
  18. Simpler solution was this: <ul> <?php $features = $pages->find("bfd_events_people_id%=$page->id, sort=bfd_year"); foreach($features as $feature) echo "<li><a href='{$feature->url}'>{$feature->title}</a></li>"; ?> </ul>
  19. Since another new clean install everything works fine. Also switched to a different FTP appliation....
  20. I solved it like this http://processwire.com/talk/topic/4615-categorisation-vs-relation/#entry46406
  21. I solved it like this: <?php $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id"); $occupation = ucfirst($namepage->bfd_people_occupation->title); if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; echo "<b><a href='{$namepage->url}'>{$occupation} {$namepage->bfd_people_name_first} {$namepage->bfd_people_name_middle} {$namepage->bfd_people_name_last}{$originally}{$alias} </a></b>"; ?>
  22. In the meantime I changed my approach.... I have a category/template 'events' that calls fields from a category/template 'people' and one 'places'. $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id"); $occupation = ucfirst($namepage->bfd_people_occupation->title); if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; echo "<b><a href='{$namepage->url}'>{$occupation} {$namepage->bfd_people_name_first} {$namepage->bfd_people_name_middle} {$namepage->bfd_people_name_last}{$originally}{$alias} </a></b>"; Before I was using "$namepage = $pages->get("template=bfd_people, title=$page->bfd_events_people_title");". To facilitate input I wanted "bfd_events_people_title" to be a select field (field as page and inputfield as AsmSelect). For some reason the titles showed up in the selectlist, I could select one but it disappeared upon save. Using 'id' as reference proves better because 'title' can change in the course of time. So to rephrase my question, could the AsmSelect field use the child pages (that have multiple fields) of the 'people' category as select items? And one step further, could I have an AsmSelect list that shows the 'title' fields as select items but yet input their 'id' in the 'bfd_events_people_id' field?
  23. I would like to have a navigation list of related pages (events) on a certain page. find("template=bfd_events, bfd_events_people_id%=$page->id") Where do I put the find option? In $rootPage = $pages->get("/events/"); or in options -> 'selector' => '',?
  24. <?php $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'MapMarker', array('height' => '350px')); ?> results in Error: Call to a member function render() on a non-object while the MapMarker field is called 'MapMarker' to keep things simple.... Why?
  25. Getting back to my places problem above. I have a 'places' template with 'name', 'street', 'district', 'city', 'state', 'country' and Mapmarker fields. Cities, states and countries are select fields. How can I get these fields into an 'event' page by referencing them to either the title field or a unique ID field? Something like having the title or ID from the 'places' page as a select list and pull the other fields from that page into the 'event' template, including the Mapmarker map.
×
×
  • Create New...