Jump to main content Jump to doc navigation

This is an example usage of Gallery. This page will first show a list of Gallery Albums, then once clicked, will load all the photos from that album. When a photo is clicked, it will show in large-form.

Simply paste this code into your Resource.

[[!Gallery? &toPlaceholder=`gallery`]]
[[!GalleryItem]]
[[!GalleryAlbums? &toPlaceholder=`galleries`]]

<div style="float: right">
    <h2>Galleries</h2>
    <ul>
        [[+galleries]]
    </ul>
</div>

<h2>Item</h2>

[[!+galitem.image:notempty=`
<div class="image">
    <a href="[[+galitem.image]]"><img class="[[+galitem.imgCls]]" src="[[+galitem.image]]" alt="[[+galitem.name]]" /></a>
    <br />Albums: [[+galitem.albums]]
    <br />Tags: [[+galitem.tags]]
</div>
`]]

<hr />

[[!+gallery:notempty=`
    <h1><a href="[[~[[*id]]]]">[[+gallery.name]]</a></h1>
    <h2>[[+gallery.description]]</h2>
    
    [[+gallery]]
`]]

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • Chris Fickling
  • CrewMark
  • deJaya
  • Lefthandmedia
  • Murray Wood
  • eydolan
  • Following Sea
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • A. Moreno
  • Nick Clark
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$301 per month—let's make that $500!

Learn more