A task which I do on most sites I build with ocPortal is to convert the existing gallery block display so it displays as a carousel. Thankfully in ocPortal this is a simple task which doesn’t require any programming knowledge. This task is achieved by installing the Gallery Carousel addon and then embedding a gallery as normal.
Installing the addon
- Log in to your adminzone
- Navigate to the Addons screen which is in the structure section of your adminzone
- Scroll down and choose import non-bundled addons and click the link
- The addon you want is under the Graphical section of the addons catalogue so expand that section and choose Gallery Carousel. You will need to select the Download section before you can expand the Graphical option.
- Once you have selected the gallery carousel addon click the Import Non-bundled addons button at the bottom of the page.
- Take a few moments to check over the list of files which will be overwritten to ensure you have not edited any of them previously which may cause issues with your site. Once you are happy click proceed
Displaying the gallery as a carousel
Now you have installed the gallery carousel addon on to your ocPortal website, the normal Gallery embed block templates will have been replaced with a carousel. All you need to do to display a carousel gallery on one of your pages is to add the main_gallery_embed and the gallery which appears will be a carousel rather than the original layout.
If you are using the Block wizard you will need to fill in the form which has the following options:
- Param – Choose the Gallery you wish to display from the dropdown list
- Select – You can choose to only display specifically numbered photo’s or if you leave it blank it will display all of them
- Videos – If there are videos in the gallery you can choose specific videos to display
- Zone – In 99% of cases you will leave this as Search as this is the zone you want to pull the content from
- Max – the maximum number of entries to display
- Title – The Title of the block
- Sort – Which order do you want the pictures to display. This could be things like date ascending, highest rating first, random etc
- Days – If you have a gallery which has new items added you may choose to only display photo’s added in the last X number of days