dab Posted April 17, 2016 Posted April 17, 2016 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.
ottogal Posted April 17, 2016 Posted April 17, 2016 $items = $pages->find('template=accommodation-page, sort=title); Could it be just a typo? (closing quote missing) 3
dab Posted April 17, 2016 Author Posted April 17, 2016 thanks....after correcting this, no php error , but procuces rendered output of (1040|1041, 'contact_gps')
ottogal Posted April 17, 2016 Posted April 17, 2016 $content.="$map->render($items, 'contact_gps')"; I think that should be $content.= $map->render($items, 'contact_gps'); (without " ") 2
dab Posted April 17, 2016 Author Posted April 17, 2016 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');
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now