# Dynamic Photo Album

A dynamic photo album in Skin CMS means that you can show 1 image, 2 images or way over 10 images and depending on the record that you're triggering, it will detect whether it's single or multiple images to show.

If it's a single image, it will hide the previous and next buttons, but if the record contains 2 or more images, it will show the previous and next buttons automatically.

<mark style="background-color:red;">Keep in mind that you need to compress the images before importing to make sure it loads fast enough.</mark>

{% embed url="<https://www.youtube.com/watch?v=Bb0SNxCYIxI>" %}
Tutorial showing you how to do it
{% endembed %}

### Gallery template

Download the template and connect your Attachments field in Airtable with `SkinCMS_Gallery_Container`.

{% file src="<https://2190804041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7wZjhCi3RG15YyVjBvgy%2Fuploads%2F6Fy3bcmOtdWB6KIgLHWf%2FSkinCMS_Gallery_Container.vtl?alt=media&token=fa892a2c-d3c0-46d0-bedd-c237899783f9>" %}

### Creating your own custom gallery

In order to make this work you create in 3DVista:

* Container and call it `SkinCMS_Gallery_Container`\
  \&#xNAN;*(not an 'image', even though images will appear in here)*
* Two buttons located inside SkinCMS\_Gallery\_Container.
  * Call the previous button `SkinCMS_Gallery_Previous`
  * Call the next button `SkinCMS_Gallery_Next`

In Airtable you've created an attachment field and uploaded one or more images in each record.

In SkinCMS you connect the Airtable's attachment field with `SkinCMS_Gallery_Container`

### Multiple Galleries

In case you need more than one gallery, which is exceptional, you can duplicate the SkinCMS\_Gallery\_Container and add a `2` behind Container like `SkinCMS_Gallery_Container2`. Keep the names for the Previous and Next the same within Container2. And connect this to another attachment field in Airtable.
