How to make link to shop filter.html with Default Value Selected

4 replies · opened Jun 2, 2020

AAdeyrooveJun 2, 2020

Dear canvas team,

Hi, I'm a beginner,
How to make link to shop filter.html with Default Value Selected?

Example :
[ Button 1 ](shop-filter.html (WITH DEFAULT VALUE Show All SELECTED)
[ Button 2 ](shop-filter.html (WITH DEFAULT VALUE Dress SELECTED)
[ Button 3 ](shop-filter.html (WITH DEFAULT VALUE Shoes SELECTED)
[ Button 4 ](shop-filter.html (WITH DEFAULT VALUE Sunglass SELECTED)
[ Button 5 ](shop-filter.html (WITH DEFAULT VALUE Watch SELECTED)

Thank you.

AAdeyrooveJun 2, 2020

I want to create a buttonn with link to shop filter.html with different Default Value Selected

Button 1 will be link to shop filter.html WITH DEFAULT VALUE Show All SELECTED
Button 1 will be link to shop filter.html WITH DEFAULT VALUE Dress SELECTED
Button 1 will be link to shop filter.html WITH DEFAULT VALUE Shoes SELECTED
Button 1 will be link to shop filter.html WITH DEFAULT VALUE Sunglass SELECTED
Button 1 will be link to shop filter.html WITH DEFAULT VALUE Watch SELECTED

Thank you

SSemicolon WebSTAFFJun 3, 2020

Hello,

This is currently not available out of the box, but we have just written a small piece of code for you which you can paste at the bottom of the Page:


	jQuery(document).ready( function(){
		let hashFilter = location.hash;
		hashFilter = hashFilter.split('#');
		if( hashFilter[1] ) {
			let filterItem	= $('.portfolio-filter').find('[data-filter="'+ hashFilter[1] +'"]'),
				filterCon	= filterItem.parents('.portfolio-filter').attr('data-container');
			filterItem.parent('li').siblings().removeClass( 'activeFilter' );
			filterItem.parent('li').addClass( 'activeFilter' );
			$(filterCon).isotope({ filter: hashFilter[1] });
		}
	});

Then you can simply add the shop.html#.filter Link to your Button just as it is added in the data-filter Attribute of the Filter Items.

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

AAdeyrooveJun 4, 2020

Dear SemiColonWeb Team,

Yeah it works!

Thank you.

Best

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard