We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38705
    • 101 Posts
    Hi,
    I dont know if this is the right place....
    Im working on an event extra for my hobby; regatta sailing

    I have a page that is returning table rows (events) with a link in there:
    <a href='[[~134? &evid=`".$id."`]]&iframe=true&width=800&height=650' >link</a>


    The page that is loaded in the iframe is a table with the subscribed people for that event.
    The header should load saying something like: "This and That Event - 2012", however this doesn't work (anymore?)
    The page correctly loads the package to let xPDO interact with the tables
    The page consists of:
    ....
    [[!Events.Subscribers.Header? &id=`[[!Events.Subscribers.EventID]]`]]
    ....


    Events.Subscribers.Header snippet looks like this:
    <?php
    $query = $modx->newQuery('Ev');
    $query->sortby('ev_id','ASC');
    $query->limit(2);
    $query->where(array(
       'ev_id' => $id,
    ));
    $evs = $modx->getCollection('Ev',$query);
    foreach($evs as $e) {
    $string =  "<h3>Deelnemers ".$e->get('ev_naam')." ".$e->get('ev_jaar')."</h3>";
    }
    return $string;


    This works most "first" times, after clicking another link, or another, or another, ans so on i get:
    Warning: Invalid argument supplied for foreach() in /home/xxx/domains/xxx.yyy/public_html/core/cache/includes/elements/modsnippet/99.include.cache.php on line 16

    where the header should be. I don't get it...

    Can anyone help?
    Michiel

    This question has been answered by mintnl. See the first response.

    [ed. note: mintnl last edited this post 13 years, 10 months ago.]
      Addict since 2012....
      • 3749
      • 24,544 Posts
      You have '&evid' in your tag and 'ev_id' in your snippet. Could that be it?


        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • discuss.answer
        • 38705
        • 101 Posts
        Hi BobRay,

        No thats not it
        [[!Events.Subscribers.EventID]]
        

        takes the $_GET['evid'] and returns that into the Events.Subscribers.Header snippet as $id.

        Thanks fort looking into it. But i fixed it the other way around.
        Just passed the header directly into the url of the resource as an $_GET with urlencode en urldecode.


        Cheers Michiel
          Addict since 2012....