0%

Galleries ID: DBT-HUCO-GAL

Marketpath CMS Galleries are used for displaying image galleries to site visitors.

Gallery Standard Fields

A Marketpath CMS Gallery has the following default fields.

  • Internal Name
  • Title
  • Folder
  • Gallery Template
  • Has URL
  • Gallery Items
  • Authors
  • Tags

Gallery Template is the template used to render the gallery.

Gallery Item Standard Fields

A Marketpath CMS Gallery Item has the following default fields.

  • Internal Name
  • Image
  • Link
  • Caption
  • Alt
  • Title
  • Class
  • Content

The only required field is Internal Name, however, a gallery will obviously not function properly without an image in each item. These are standard fields you can use however you want in your gallery. What you use is dependent on your gallery implementation.

Sample Gallery Code

Here's some sample code of an image gallery that adds a javascript reference and renders the HTML for the gallery images.

{% add_javascript "gallery" %}

<div class="gallery">
    <div class="full">
        {% for item in entity.items %}
            <div class="slide">
                <img src="{% image_url output_to_template item.image %}">
            </div>
        {% endfor %}
    </div>
</div>

Other Ways to Build Galleries

Using the Gallery object and a gallery template in Marketpath CMS is not the only way to build a gallery. Here are some other common methods for building galleries.

Custom Field Image List

You can extend any object with custom fields by adding an image list. This restricts you to the fields in the Image object but allows for a simple, in context way to edit a gallery.

Datastore

You can build a custom datastore and use it as a gallery. This is a great approach when Marketpath's standard Gallery Item object doesn't have all the fields you need.

Tags & Folders

You can build a gallery by loading all images that have a specific tag or folder. This also restricts you to the fields in the Image object.

Other Considerations

Galleries have grown in popularity across the internet and while they are the focus of a healthy usability debate we do not expect them to go away any time soon. As a developer, you should be prepared to enable content creators to quickly and easily build their own re-usable and one-time galleries just the way they want them.

To facilitate custom galleries, we put you - the developer - squarely in the middle of the gallery creation process. Every gallery that is created in the CMS has the option of selecting a "gallery template" to determine how it is displayed. It is up to you to create those galleries to the satisfaction of your content creators.



Feedback?

Please fill out the form below with your feedback or any questions you may have after working through the "Galleries" lesson.

Your Name
Email 
Feedback / Questions