filter portfolio with drop down menu in v5.0

1 reply · opened Feb 20, 2018

JjogjandrewFeb 20, 2018

Hello,

I was using the following code to filter a portfolio with a simple pull-down menu in v4.5. After upgrading to v5.0, selecting from the pull down menu just jumps me to the top of the page. It does not filter the portfolio as before. If I change COMBINATION-FILTER to PORTFOLIO-FILTER it filters the portfolio properly, but I don't get the nice simple vertical list in the drop-down.

What would be the best way to get the same drop-down menu, filter functionality in v5?


	
		Filter Projects by Type 
			
				
- [Show All](#)
				
- [Design](#)
				
- [Development](#)
				
- [CAD](#)
				
- [Rendering](#)
				
- [Prototyping](#)
				
- [Sourcing](#)
				
- [Quality Assurance](#)
				
- [Production Management](#)
				
- [Outdoor](#)
				
- [Indoor](#)
				
- [Contract](#)
				
- [Marine](#)
				
- [Decor](#)
			
		
	

...

		jQuery(window).load( function(){
			var filters = {};

			var $container = $('.grid-container');

			$container.isotope();

			$('.combination-filter').on( 'click', '.dropdown-menu a', function() {
				var $this = $(this);
				// get group key
				var $buttonGroup = $this.parents('.btn-group');
				var filterGroup = $buttonGroup.attr('data-filter-group');
				// set filter for group
				filters[ filterGroup ] = $this.attr('data-filter');
				// combine filters
				var filterValue = concatValues( filters );
				$container.isotope({ filter: filterValue });

				$buttonGroup.toggleClass('open').find('.filter-text').html( $this.html() );

				return false;
			});

			// flatten object by concatting values
			function concatValues( obj ) {
				var value = '';
				for ( var prop in obj ) {
				value += obj[ prop ];
				}
				return value;
			}

			$(window).resize(function() {
				$container.isotope('layout');
			});
		});

	
SSemicolon WebSTAFFMar 1, 2018

Hello,

This issue could be due to the Bootstrap 4 upgrade. Please follow the Bootstrap 4 migration guide: http://getbootstrap.com/docs/4.0/migration/ to make sure that your codes follow the new Dropdown Markup.

This should automatically fix the issue. Hope this Helps!

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

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