Is there a way to set two separate views with exposed filters in a panel page?

I have been attempting to create a panel page with two columns, one to display view1 and the other view2. The intent is to have the user choose a content type in each column using exposed filters and have the list of content displayed by the view in the panel page. This has turned out to be more complicated to execute than I first thought.

The problem is with the URL. I can have a URL to invoke the panel page, eg.relate/relate, and it will display the same list of all content in each column by default. However, when I change the content type in one of the columns, the URL is changed in response and only the changed view is displayed (the panel is not longer activated.

So I am trying to find a way to manage two views from the same page panel that either does not change the URL request or that the panel can manage correctly.

I have tried passing both content type names in the URL eg. relate/%type1/%type2 and have each view read one of the URL positions using contextual filters. This has approach has several problems

  1. I am not sure how to tell the view contextual filters how to react to only the relevant wildcard in a two wildcard URL relate/%/%.
  2. How do I set up a contextual filter to read the value in the path segment and interpret it as a filter for a content type? The contextual filter can be set up to read the raw URL path segment (in the section re: what to do when the filter fails), but there does not appear to be a way to set up the validation to determine a content type.

Has anyone ever achieved this or can you suggest an approach that might work?

ADDITIONAL INFO

I found that I can prevent the URL from changing by setting a n option in the view content pane to use the Panel URL. This keeps the display as two columns (from the panel), but does not unlink the two similar view content panes. They still both change when I set the exposed filter for either. Apparently the exposed filter is only created once , but displayed twice and sends its setting to both panes. I found this to be true even if I create two distinct View definitions. If the settings for the filters are the same they appear to both run if either exposed filter is changed.

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Is there a way to set two separate views with exposed filters in a panel page?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.