We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38793
    • 18 Posts
    I hope putting this here is ok as I am having a problem with using Wayfinder and getResources

    When I use a Gallery call in a chunk that is being called by wayfinder or getresources i get the following error:

    Notice: Uninitialized string offset: 0 in C:\wamp\www\kanemi.info\core\cache\includes\elements\modsnippet\5.include.cache.php on line 106
    
    Warning: Invalid argument supplied for foreach() in C:\wamp\www\kanemi.info\core\cache\includes\elements\modsnippet\5.include.cache.php on line 106
    
    Fatal error: Cannot use string offset as an array in C:\wamp\www\kanemi.info\core\cache\includes\elements\modsnippet\5.include.cache.php on line 165


    I have read through the docs and also done some searching to see if there is a way to call a snippent inside a snippet.

    my wayfinder call:

    [[Wayfinder? &startId=`15` &outerTpl=`outerTpl_gal` &rowTpl=`rowTpl_gal`]]
    


    The chunk that contains the gallery call (&rowTpl=`rowTpl_gal`) :

    <div class="ap_collections_thumbs_container">
    <div class="ap_collections_title_text">
    <span>[[+name]]</span>
    </div>
    
    [[!Gallery?
    &album=`[[+id]]`
    &limit=`5`
    &thumbWidth=`165`
    &thumbHeight=`165`
    &thumbTpl=`gallery_thumbs_tpl`
    ]]
    
    
    </div> <!-- ap_collections_thumbs_container END -->



    when i view the page to see the output it gives me the error above. I also get this problem when using getResources to use a template chunk that contains a gallery call

    can anyone give me a clue to where i am going wrong.

    Thanks

    Tim
      • 3109 ☆ A M B ☆
      • 894 Posts
      What are you trying to do and why do you want to call gallery from within wayfinder, you are just asking for trouble why not use getResources and customize it to do what you want.

      Do you have a sample of what you are trying to achieve?
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 38793
        • 18 Posts
        Thank you for replying,

        your answer tells me that i am going about this the wrong way.

        The reason why I went down this route was due to getting stuck linking to a resource page when using Gallery.

        *update* just found this post in the gallery section that seems to be giving a similar error to mine https://forums.modx.com/thread/50651/solved-use-galleryitem-from-tv-as-link-to-resource#dis-post-429235


        here is my resource tree:

        -Galleries
        	-Artwork (container)
        	   -artwork gal 01
        	   -artwork gal 02
        	   -artwork gal 03
        	-photography (container)
        	   -photo gal 01
        	   -photo gal 02



        when you view the Galleries page you get a list of the sub galleries with 5 thumbnails for each gallery and a link to click to view that gallery.

        Originally as i stated above i was running into problems trying to figure out how to link to the Resource page using the gallery plug in.

        So i tried to go about it a different way by using getResources or wayfinder to achieve what i want.

        maybe what i should have done is asked how to link to resource page when using gallery.


        Tim [ed. note: timbo_la last edited this post 13 years, 7 months ago.]
          • 38793
          • 18 Posts
          I have started a new post in the Gallery add on section as i thought it belonged in there better, than in general support

          https://forums.modx.com/thread/82773/how-to-link-to-a-resource-page-when-listing-your-galleries#dis-post-456745

          Tim