Hi there!
Another problem...
I'm using the
Gallery-plugin installed via
Package Management in the Backend. By using
Gallery I also use the implemented plugin
galleriffic for displaying my albums.
Then I needed to have two galleries on one page (or maybe more), which seemed to be hard to get working, but I found a solution here:
https://code.google.com/p/galleriffic/issues/attachmentText?id=76&aid=-3045121742886940548&name=example-2.html&token=ABZ6GAdK-rPP2Lo90yMz9z2JD57OJr3XdA%3A1405608691341
In short, you have to assign
unique-ids to some of the placeholders (imageContainerSel,thumbsContainerSel,controlsContainerSel,loadingContainerSel) to get multiple galleries running on one page.
So I first created
two different chunks called
Galerie-multiple-neu and
Galerie-multiple-neu2, each with
unique-ids for the needed placeholders for testing purposes:
<div class="each-gallery">
<div class="slideshow-container">
<div id="loading
1" class="loader"></div>
<div id="slideshow
1" class="slideshow"></div>
</div>
<div id="thumbs
1" class="navigation">
<ul class="thumbs noscript">
[[+thumbnails]]
</ul>
</div>
<p>[[+gallery.description]]</p>
<div style="clear: both;"></div>
</div> <!--Ende "each-gallery"-->
Same for the second chunk, but this time with interchanged id's from "
1" to "
2".
Those chunks got used with these two Gallery-galleriffic-calls:
[[!Gallery?
&album=`4`
&plugin=`galleriffic`
&gallerifficContainerTpl=`Galerie-multiple-neu
1`
&thumbsContainerSel=`#thumbs
1`
&imageContainerSel=`#slideshow
1`
&controlsContainerSel=`#controls
1`
&loadingContainerSel=`#loading
1`
]]
[[!Gallery?
&album=`3`
&plugin=`galleriffic`
&gallerifficContainerTpl=`Galerie-multiple-neu
2`
&thumbsContainerSel=`#thumbs
2`
&imageContainerSel=`#slideshow
2`
&controlsContainerSel=`#controls
2`
&loadingContainerSel=`#loading
2`
]]
For testing it worked well...both galleries are shown and working separately.
Then I thought it would be good if the
unique-ids could be provided dynamically somehow else, because I don't know how many galleries may be displayed on a page in the future...
So I rememberred the "
idx"-parameter, you can use with the getPage-call:
[[!getPage@infinite_scroll?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`80`
&limit=`3`
&pageVarKey=`page`
&sortby=`id`
&includeTVs=`1`
&processTVs=`1`
&includeContent=`1`
&idx=`1`
&showHidden=`1`
&tpl=`Galerie-Multiple-Test-neu`
&pageNavOuterTpl=`</p><noscript>[[+first]][[+prev]][[+pages]][[+next]][[+last]]</noscript><p>[[+next]]`
&pageNavTpl=`<a[[+classes]][[+title]] id="next" href="[[+href]]">[[+pageNo]]`
&pageActiveTpl=`<a[[+activeClasses:default=` class="active"`]][[+title]] id="next" href="[[+href]]">[[+pageNo]]`
&pageFirstTpl=`<a[[+classes]][[+title]] id="next" href="[[+href]]">First`
&pageLastTpl=`<a[[+classes]][[+title]] id="next" href="[[+href]]">Last` &pagePrevTpl=`<a[[+classes]][[+title]] id="next" href="[[+href]]" id="previous"><<`
&pageNextTpl=`<a[[+classes]][[+title]] id="next" href="[[+href]]" id="next">>>` ]]
Then I changed my
Galerie-Multiple-Test-neu-chunk to this:
<div class="each-gallery">
<div class="slideshow-container">
<div id="loading
[[+idx]]" class="loader"></div>
<div id="slideshow
[[+idx]]" class="slideshow"></div>
</div>
<div id="thumbs
[[+idx]]" class="navigation">
<ul class="thumbs noscript">
[[+thumbnails]]
</ul>
</div>
<p>[[+gallery.description]]</p>
<div style="clear: both;"></div>
</div> <!--Ende "each-gallery"-->
I created a new parent-folder with 4 ressources inbetween. Each resource has a
Gallery-call like:
[[!Gallery?
&album=`
4`
&numThumbs=`6`
&limit=`0`
&autoStart=`1`
&plugin=`galleriffic`
&gallerifficContainerTpl=`Galerie-multiple-neu`
&thumbsContainerSel=`#thumbs
[[+idx]]`
&imageContainerSel=`#slideshow
[[+idx]]`
&controlsContainerSel=`#controls
[[+idx]]`
&loadingContainerSel=`#loading
[[+idx]]`
]]
The only thing I changed is the
ID of each
&album=`ID` row (to 1,2,3,4)...
This also works well with three galleries I tested. I reload the site, all three galleries get shown like they should.
And now here comes my problem:
The fourth gallery is "behind" the
getPage-limit I set to 3. I also added the
infinite-scroll-script to show more resources that are nested inside the parent-folder by clicking a "show more"-link. This works fine as intended, as long there is no other
Gallery-call inside one of the additioned resources that get shown on click.
When I edit my limit-value to 4, the fourth resource of the parent with the Gallery-call within gets shown correctly, all further resources which contain only text work fine as well, but as soon as another resource with a Gallery-call gets additioned the gallery doesn't work ( only two thumbnails get shown (instead of 6), css is broken, big picture missing, album-desciption placed wrong (due to the broken css)...
In the html-source-code I can see, that the [[+idx]] starts again to count from 1 with each resource that gets additioned. So i don't have a
unique-ids like i need to...
Another try of mine was to use the [[+id]]-parameter to use the id of the album and use this.
So I changed all "[[+idx]]" to "[[+id]]" inside my Gallery-calls. Now i see in the html-source-code that each gallery and the needed placeholders have a
unique-ids like it's wanted.
But this still doesn't work with any resource that gets additioned by the infinite-scroll-script on click on the "show more"-link.
Any hint would be highly appreciated!
Cheers!
[ed. note: profilneurotiker last edited this post 9 years, 9 months ago.]