dab
Members-
Posts
152 -
Joined
-
Last visited
Everything posted by dab
-
All possible.....for the maps you can select what items you show on your map based on any field (for your specific turtle page): $items = $pages->find("marker_colour=red"); My code here: // LEAFLET MAP WITH BICYCLE ICONS $items = $pages->find("marker_icon=bicycle"); $map = wire('modules')->get('MarkupLeafletMap'); $options = array( 'markerFormatter' => function($page, $marker_options) { if ($page->marker_icon->title) { $marker_options['icon'] = $page->marker_icon->title; } if ($page->marker_colour->title) { $marker_options['markerColor'] = $page->marker_colour->title; } // And the icon colour. This is another text field. Colour values like White, Black or an RGB value are ok here. if ($page->marker_icon_colour->title) { $marker_options['iconColor'] = $page->marker_icon_colour->title; } return $marker_options; }, 'popupFormatter' => function($page) { $out[] = "<strong>$page->summary</strong>"; $out[] = "<a href=\"$page->url\" ><img src=\"{$page->summary_image->url}\" class=\"image fit\" /></a>"; $out[] = "<img src=\"{$page->summary_image->url}\" width=\"200\" height=\"200\" />"; // ** NB: Use escaped double quotes if HTML attributes needed ** return implode('<br/>', $out); } ); and for items from different categories (species for your big map): $items = $pages->find("marker_colour=red|green|blue"); Remember you can use: 'red', 'darkred', 'orange', 'green', 'darkgreen', 'blue', 'purple', 'darkpuple' & 'cadetblue' and any icons from your version of Awesome icons: http://fontawesome.io/icons/ Beneath each map you can summarise revevant posts for each region or each species with the page find function based on an "options field type": $features = $pages->find('species=loggerhead');
-
Best approach is to just make your template responsive. I've found this template very easy to implement: http://getskeleton.com/
-
Yes, change lines 165 & 166 in MarkupLoadRSS.module to to 'stripTags' => false, // Strip any markup tags that appear in the feed? (default: true) 'encodeEntities' => false, // Whether to automatically decode and re-encode the entities for all fields (default: true) Works a treat !
-
@netcarver A fantastic job, very quickly completed. Nice work !
-
Hi, looking for someone who can help me with adding custom markers to and custom popup fields to a template on a small project... As per these two posts... https://processwire.com/talk/topic/9745-module-leaflet-map/?do=findComment&comment=93661 https://processwire.com/talk/topic/9745-module-leaflet-map/?do=findComment&comment=114967 PM me if you can help. Thanks.
-
Error seems to have resolved with new cron. Thanks will try with "/dev/null 2>&1" if it repeats.
-
Thanks....No ProCache running. Most odd. I'll try & see if I can find way was causing this.
-
I love this module, thanks . All working fine but on Cpanel every time I run script is run via cron it generates an output file in the web root folder e.g. index.html?hash\=d5c0307523750320573253247177dc.9999 Files soon build up when the script is run every 5 min! Any way to suppress the output file (it contains an html copy of the page being updated)?
-
Success, adding to MarkupGoogleMap.js... (not RCDMap.js!) var ctaLayer = new google.maps.KmlLayer({ url: 'http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml', map: this.map }); at line 126... Thanks for help!
-
...looks like "RCDMap.js" is a verision of "MarkupGoogleMap.js" from the module (link).
-
bernhard, thanks for the super speedy reply - you make it look so easy! Was trying to integrate the code in with the Map Marker Javascript code (from earler in support thread). I'll try & find the link...
-
Map Marker Map is working smoothly with PW 2.7.2, thanks for all the support tips on this thread... I want to display a kml file on the map along with my markers. I've looked at the Google support: https://developers.google.com/maps/documentation/javascript/examples/layer-kml & tried adding code var ctaLayer = new google.maps.KmlLayer({ url: 'http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml', map: RCDMap.map }); to RCDMap.js after line 47...But am struggling to get the kml to display. Can anybody help with some any pointers? Thank you.
-
If you are using delayed output hope this helps: function truncateText($text, $maxlength = 350) { // truncate to max length $text = substr(strip_tags($text), 0, $maxlength); // check if we've truncated to a spot that needs further truncation if(strlen(rtrim($text, ' .!?,;')) == $maxlength) { // truncate to last word $text = substr($text, 0, strrpos($text, ' ')); } return trim($text); } // NEWS SUMMARY $features = $pages->find('template=news-page, limit=10, sort=-news_date'); foreach($features as $feature) { $content.=" <div class='row'> <div class='4u 12u$(xsmall)'> <p> <a href='{$feature->url}' title='{$feature->title}'><img src='{$feature->image->url}' alt='{$feature->title}' /></a> </p> </div> <div class='8u 12u$(xsmall)'> <h2><a href='{$feature->url}'>{$feature->title}</a> - ({$feature->news_date})</h2> <p>"; $content.=truncateText($feature->summary); $content.="...</p> <p><a href='{$feature->url}' class='button'>More</a></p> </div> </div> <hr>"; }
-
ottogal, thank you ever so much! As you suggested (without " ") worked: // Map output. $content.="<h2>map</h2>"; $items = $pages->find("template=accommodation-page, sort=title"); $map = $modules->get('MarkupGoogleMap'); $content.= $map->render($items, 'contact_gps');
-
thanks....after correcting this, no php error , but procuces rendered output of (1040|1041, 'contact_gps')
-
I am learning how to use delayed output templates (which is reducing the number of tempate files considerably) & wish to append a different type of map at the bottom of each page content section using a placeholder in each template file e.g. map1.php, map2.php by varying $items = $pages->find('template=xxxxxx, sort=title); main.inc is <html> <head> <title><?php echo $headline; ?></title> </head> <body> <div id='body'> <?php echo $content ?> </div> </body> </html> The map code works fine for direct output: <?php $items = $pages->find("template=attraction-page, sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'contact_gps'); ?> but I am strugiling to get the map code to work in the "placeholder" for delayed output (below)...something like this.... $content.="<h2>Map</h2>"; $items = $pages->find('template=accommodation-page, sort=title); $map = $modules->get('MarkupGoogleMap'); $content.="$map->render($items, 'contact_gps')"; Can any one help me? So sorry, probably a very stupid basic error...Thank you.
-
how could i send to different receipent on same enquiry form
dab replied to adrianmak's topic in General Support
Not sure if I am off topic... but I have a contact form on each (user) page, with form output needing to go a specific email address associated with that (unique) page. So....create a field holding the email address for that page e.g. {contact_email} Then add the Contact Form Module to your template.... <?php $options['emailTo'] = $page->contact_email; $options['emailSubject'] = 'Enquiry via xxxxxx website'; echo $modules->get('SimpleContactForm')->render($options); ?> note the 'emailTo' overrides what ever you have set in the Simple Contact Form "emailTo" Settings ...neat eh? See here for more details: https://github.com/justonestep/processwire-simplecontactform/blob/master/doc/usage-advanced.md Use a select field in the form to choose which email address is selected....? -
Hope this helps someone: If you you have a "standalone" hard-coded link in your template e.g to a site map page, this code will allow the url to work alongside multi-language url support: <a href="<?php $sitemap = $pages->get("/site-map/"); echo $sitemap->url; ?>"><?php echo __('Site Map'); ?></a>
-
thanks, will take a look. DaveP: Great, I hadn't spotted you can select images from another page. This looks useful as well: http://modules.processwire.com/modules/media-library/ & this: https://processwire.com/talk/topic/11224-media-manager/
-
Hi, When I upload an image or a pdf to a page via the Processwire admin in to an "Image" or a "File" Field the files are placed in to a directory specific to that page. e.g. ....site/assets/files/1026/file2015.pdf If I then want to add the same image or make a link to the same PDF from another page, the image or pdf does not seem to be available to be linked to from the "Image" or "File" field. Is there any way to share uploads across fields (as you can with Modx). Hope I've not missed the obvious here. With thanks. ...I'm enjoying learning Processwire, thanks everybody!