Hi all, my problem has nothing to do with the CMS, which is getting better and better btw., but maybe someone with more knowledge of js can guide me into the right direction.
I build a nice gallery with isotop https://isotope.metafizzy.co/. Wich is working fine so far. But at the moment I want to link to a special category from another page I'm lost. There are a lot of options to filter the gallery. One is the url hash filtering https://isotope.metafizzy.co/filtering.html#combination-filters-ui. So it should be possible to build a link.
However, several people found several solutions https://github.com/metafizzy/isotope/issues/594 but nothing works for me as i dont know were to place the js. Cracking my head for 2 days now
This is my js:
HTML:
Anyone who worked with isotope or simmilar yet? I'm willing to pay a coffee if usefull help is provided. And it would be a nice plugin for our couchcms as well.
Thank you!
I build a nice gallery with isotop https://isotope.metafizzy.co/. Wich is working fine so far. But at the moment I want to link to a special category from another page I'm lost. There are a lot of options to filter the gallery. One is the url hash filtering https://isotope.metafizzy.co/filtering.html#combination-filters-ui. So it should be possible to build a link.
However, several people found several solutions https://github.com/metafizzy/isotope/issues/594 but nothing works for me as i dont know were to place the js. Cracking my head for 2 days now

This is my js:
- Code: Select all
// galerie
$(window).load(function ( ) {
var $container = $('.grid');
$container.isotope({
filter: '*',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});
$('.root a').click(function(){
$('.root .selected').removeClass('selected');
$(this).addClass('selected');
var selector = $(this).attr('data-filter');
$container.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});
return false;
});
});
//-Test hash
$(window).load(function(){
// Store # parameter and add "." before hash
var hashID = "." + window.location.hash.substring(1);
// the current version of isotope, the hack works in v2 also
var $container = $('.grid');
$container.imagesLoaded(function(){
$container.isotope({
itemSelector: ".grid-item",
filter: hashID, // the variable filter hack
});
});
});
//-Test hash End
$('.grid').isotope({
// set itemSelector so .grid-sizer is not used in layout
itemSelector: '.grid-item',
percentPosition: true,
masonry: {
// use element for option
columnWidth: '.grid-sizer'
}
});
HTML:
- Code: Select all
<div class="grid">
<div class="grid-sizer"></div>
<cms:pages masterpage='galerie.php'>
<cms:if k_folder_name ><cms:set current_folder=k_folder_name /></cms:if>
<cms:if k_page_foldername ><cms:set current_folder=k_page_foldername /></cms:if>
<figure class="grid-item <cms:parentfolders folder=k_page_foldername >
<cms:show k_folder_name/></cms:parentfolders> ">
<a href="<cms:show gg_image/>" title="<cms:show k_page_title/>" class="swipebox" rel="galerie">
<figcaption>
<span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
<p><cms:show k_page_title/></p>
</figcaption>
</a>
<img src="<cms:show gg_thumb/>" alt="<cms:show k_page_title />">
</figure>
</cms:pages>
</div>
Anyone who worked with isotope or simmilar yet? I'm willing to pay a coffee if usefull help is provided. And it would be a nice plugin for our couchcms as well.
Thank you!