• Hi All,

    With the blog app there is an option like perch_blog_custom so I can display the last 6 blogs on a rolling banner on the main page.

    1. perch_blog_custom(array(
    2.     'sort'=>'postDateTime',
    3. 'sort-order'=>'DESC',
    4. 'template'=>'blog/list-blog.html',
    5. 'count'=>6
    6. ));

    The question is;

    Is there something similar for the Gallery App?


  • There are several functions available to you and you'd probably want to use perch_gallery_images(). I am not sure if it takes the sort and count options but don't see why not with something like the code below. I haven't used Gallery since Perch 1 which is quite a while ago!

    1. perch_gallery_images([
    2.     'template' => 'your_template_here.html,
    3.     'sort' => 'your sort id here',
    4.     'sort-order => 'random', // For a random set of images
    5.     'count' => 6
    6. ]);

    Give it a go and let us know!

    NB For the future – the Gallery app as it stands is end of life and no longer supported so be warned!

  • ellimondo Thanks for the help.

    The code you supplied was almost what I needed. It at least pointed me in the right direction. In the end I needed to list the galleries.

    example below;

    1. perch_gallery_albums(array(
    2. 'template' => 'template_file.html',
    3. 'image' => true,
    4. 'count'=>6,
    5. ));

    Thanks again for the help