We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32017
    • 151 Posts
    Ill try explain as easy as possible.

    I’m builda car listing site and have custom TVs for each document to show the cars price, year and mileage.

    I call maxigallery child galleries code with ditto and in my maxigallery template use the tvs:

    [+maxigallery.pageinfo.tv.price+]
    [+maxigallery.pageinfo.tv.year+] 
    [+maxigallery.pageinfo.tv.miles+]
    


    which works fine when I have two documents in the parent but as soon as I have a third document, maxigallery cant handle it and spits out the error:

     Error:	Invalid argument supplied for foreach()	 
      Error type/ Nr.:	Warning - 2	 
      File:	/home/public_html/assets/snippets/maxigallery/maxigallery.class.inc.php	 
      Line:	768	 
      Line 768 source:	 foreach ($resources as $res) {


    My ditto call is simple, [!Ditto? &tpl=`cars` &display=`all`!]

    cars tpl code

    <a href="[~[+id+]~]">[+title+]</a>
    
    [[MaxiGallery? &display=`embedded` &manageButtonTpl=`CODE:` &childgalleries_ids=`[+id+]` &childgalleries_level_limit=`1` &childgalleryTpl=`[b]showroom[/b]` &limit=`1` &display=`childgalleries` &order_by=`random` &childgalleries_order_by=`createdon`]]
    
    


    my showroom tpl code

    <a href="[+maxigallery.childurl+]"><img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" /></a>
    
    [+maxigallery.pageinfo.tv.price+] <br />
    [+maxigallery.pageinfo.tv.year+]<br /> 
    [+maxigallery.pageinfo.tv.miles+]
    


    why will it load in two and not any more than that sad


      London web design - MODx specialists