Gallery is there a way to separate the links to templates?

I would like it if I click a galleryalbum it appears on a new resource with its own template.
Same with the individual pages.
This is the code I am using.


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

<hr />

[[!Gallery? &toPlaceholder=`gallery`]]
<h1><a href="[[~[[*id]] &galAlbum=`[[]]`]]">[[]]</a></h1>


You probably have to use a custom chunk instead of “galAlbumRowWithCoverTpl”

and replace [[*id]] with the resource-ID where you want to show the album.

1 Like

Would I replace the id like this

Just replace [[*id]] with the resource-ID → <a href="[[~13? &[[+albumRequestVar]]=`[[+id]]`]]">.

1 Like

That works.
Do I do the same thing with the gallery thumb to open a single image in a new page?
Do I alter galItemThumb?


It seems you have to create another custom chunk and change [[*id]] to a fixed resource-ID again.

1 Like

Now I need to add a class to the first image in the Gallery.

      <div class="[[+cls]]">
      <a href="[[+linkToImage:if=`[[+linkToImage]]`:is=`1`:then=`[[+image_absolute]]`:else=`[[~[[*id]]?
            &[[+tagRequestVar]]=`[[+tag]]` ]]`]]">
        <img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" />

Can I use the +cls placeholder with output modifiers?

There is a placeholder [[+idx]] for the index of the image.
You could probably to something like this:

<div class="[[+cls]][[+idx:is=`0`:then=` first`]]">
1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.