Display galleries in theme

@if (function_exists('render_galleries'))
   {!! render_galleries(8) !!}

It will use template plugins/gallery/resources/views/gallery.blade.php to render gallery

 * @param $limit
 * @return mixed
 * @author Sang Nguyen
function render_galleries($limit)
    return view('', compact('limit'));

If you need to custom display of list galleries, you just need to copy the content of plugins/gallery/resources/views/gallery.blade.php and customize it in your theme.

Display galleries for page, post

For page: Add in your-theme/page.blade.php

@if (defined('GALLERY_MODULE_SCREEN_NAME') && !empty($galleries = gallery_meta_data($page)))
  {!! render_object_gallery($galleries) !!}

For post: Add in your-theme/post.blade.php

@if (defined('GALLERY_MODULE_SCREEN_NAME') && !empty($galleries = gallery_meta_data($post)))
    {!! render_object_gallery($galleries, ($post->categories()->first() ? $post->categories()->first()->name : __('Uncategorized'))) !!}

How to add gallery to your plugin

  • Open /plugins/<your-plugin>/src/Providers/<YourPlugin>ServiceProvider.php. Add below code to function boot