Jump to content

MarkupGoogle Map With Delayed Output Templates


dab
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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');
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...