Adding a Gallery Layout

The Fusion Gallery Element has built-in functionality that allows it to be expanded with additional layouts. This helps to keep the Fusion UI from getting cluttered with overly similar elements while keeping like-functionality conveniently grouped.

Adding a Gallery Layout is a simple three step process:

1. Use the add_gallery_layout filter to define the name, parameters, and item parameters of your gallery layout in an array. Then give this array a unique key name and add it to the array of defined gallery layouts that gets passed to the filter. The parameters (params) that you define will apply to the gallery as a whole and the item params (item_params) that you define will apply to each individual gallery item.

2. Add a function to return the output of your gallery wrapper. This function gets called by the [fsn_gallery] shortcode and must follow the naming format fsn_get_[gallery layout key]_gallery. In this function you will use the params that you defined in your layout.

3. Add a function to return the output of your gallery items. This function gets called by the [fsn_gallery_item] shortcode and must follow the naming format fsn_get_[gallery layout key]_gallery_item. In this function you will use the item_params that you defined in your layout.

Now when you select your gallery layout from the Type select box in the Gallery element, the parameters you have defined will be loaded into the element for the user to populate.

Example

Still need help? Contact Us Contact Us