• I’m trying to get content from all Childs of a parent page (ID26). The fields I want to get are:

    the_title()
    the_permalink()
    get_post_custom_values(“Latitude”)
    get_post_custom_values(“Longitude”)
    get_post_custom_values(“SpotShortname”)

    I want to loop them in a Javascript that renders locations on a Google Map. To do this I need to be able to run a loop for each record, this is my trouble, I can’t get to the pages, only one by one.

    Example of what i’m trying:

    <?php global $post;
    $myspots = get_posts(‘child_of=26$exclude=724,741,743,745,749’);
    foreach($myspots as $post) :
    ?>

    var <?php get_post_custom_values(“SpotShortname”); ?> = new GMarker(new GLatLng(<?php get_post_custom_values(“Latitude”); ?>, <?php get_post_custom_values(“Longitude”); ?>), spot_small);

    // info vindu andre spotter
    GEvent.addListener(<?php get_post_custom_values(“SpotShortname”); ?>, “click”, function() {
    <?php get_post_custom_values(“SpotShortname”); ?>.openInfoWindowHtml(‘<div style=”width:250px;padding:0px;”><h4>“><?php the_title(); ?></h4>

    </div>’);
    });

    map.addOverlay(<?php get_post_custom_values(“SpotShortname”); ?>);

    <?php endforeach; ?>

    Anyone with a solution?

The topic ‘Dynamic map rendring with content from pages’ is closed to new replies.