Hallo zusammen,
gibt es eine Möglichkeit, innerhalb der Isotope-Filterung auf eine andere Seite zu verlinken. Und wenn man dann auf der Unterseite ist, wird wieder auf den jeweiligen Filter verlinkt?
Ich habe es so hinbekommen, dass die Filterung funktioniert und ich kann einmal auf eine andere Seite verlinken. Wenn ich aber auf der gewählten Seite bin funktioniert das Ganze nichtmehr. Weder die Verlinkung zurück noch die Filterung an sich. Hat jemand eventuell schonmal ein ähnliche Funktion gehabt und kann mir eventuell weiterhelfen?
Anbei mein Code-Ausschnitt:
PHP
<!-- Ausgabe Kategorien auf den jeweiligen Seiten-->
<ul id="filters">
<?php
$terms = get_terms("category"); // get all categories, but you can use any taxonomy
$count = count($terms); //How many are they?
if ( $count > 0 ){ //If there are more than 0 terms
foreach ( $terms as $term ) { //for each term:
echo "<li><a href='#' data-filter='.".$term->slug."'>" . $term->name . "</a></li>\n";
//create a list item with the current term slug for sorting, and name for label
}
}
?>
<li><a href="http://localhost:8888/listen/listenleipzig" data-filter="http://localhost:8888/listen/listenleipzig">listenleipzig</a></li>
<li><a href="http://localhost:8888/listen/about" data-filter="http://localhost:8888/listen/about">listenberlin</a></li>
<li><a href="http://localhost:8888/listen/about" data-filter="http://localhost:8888/listen/about">listenmünster</a></li>
</ul>
<!-- Isotope Jquery-->
jQuery(function ($) {
var $container = $('#isotope-list'); //The ID for the list with all the blog posts
$container.isotope({ //Isotope options, 'item' matches the class in the PHP
itemSelector : '.item',
layoutMode : 'masonry'
});
// filter items when filter link is clicked
$('#filters a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
});
Alles anzeigen
Herzlichen Dank.