Can one apply a Panels layout to a Views page?

Events happening in the community are now at Drupal community events on www.drupal.org.
rayhill's picture

I've been learning to use Panels in D7 and am pretty much in love with it in most aspects. Unfortunately, I've hit a wall that I can't seem to get around.

I have created a content type for "Common Issues" (for a software support site). I then created a View that shows just that content type. It has a Page version, as well as a Block and Content Pane version, which I insert into panels sidebars on various pages. So far so good.

To reskin the individual Issues pages, I have a panel layout with selection rules set to that content type and it works like a charm. On my static pages, I have panel layouts with selection rules set to match the URL path, and again no problems.

The trouble comes when I try to apply a panel layout to the Page version of my view. I have the URL pattern for the Page version of the view set to "support/issues" and a panel layout set with the selection rule to match the same URL. But when I go to the page, it just shows the unmodified view results and none of the panels content.

Is there some step I'm missing in order to skin a Views page with panels? Or is this something Panels isn't currently able to do?

Thanks,

--ray

Comments

try panels fields

g76's picture

Select "panels fields" as your display option(this will let you select a panel layout within views), then delete the panels page and keep the views page url. If you need anything at all or have trouble finding the options, just contact me, I'm usually around:)

Panels can't override a page

jason.bell's picture

Panels can't override a page path set in Views. Typically when using Panels I typically avoid mkaing Page displays with Views. Here are three ways to style your Views based page using panels:

  1. Set the display style in your View to show Panel Fields
  2. Create a new Context display of your View, then create a custom page using Page Manager and load in the View as a context for the page (awesome!)
  3. Create a Content Pane of your View, create a custom page (the path you previously used in your Views page display) and use the pane as content there.

Number 2 is a cool method to use since it loads all the parts of your view (header, rows, footer, empty text) as content panes that can be displayed in your custom page. I would suggest trying all three so you can see the differences between them. Have fun!

Thanks, guys! I ended up

rayhill's picture

Thanks, guys!

I ended up using a basic page in order to allow panels to override the URL, then having a separate non-page view option to insert into one of the panes.

Jason, I'll tinker with the other options later, once deadline is less of an issue. :-)

Cheers,

--ray

RKopacz's picture

I have a similar question, not sure if this is the right place to ask, but let's try. If you can suggest a better forum, please let me know.

I have built a site for a private group of families that works similarly to myfamily.com using Organic Groups. I have followed Itangalo's excellent screencast on Nodeone to create this. The groups are called "family", and each group has three types of group content: History, News and Photos. The Main Group page, uses Itangalo's examples with page manager and panels to pull in a view pane for each content type, which lists the titles of the most recent items of group content for each group content type, and a "more" link to the Views page for each content type, which also has the contextual filter to only show the content for that particular group.

I would like that views page to also be displayed with panels, so that I can produce a sidebar using the panels two column layout, but I am not finding a way to do this.

Does anyone have an idea how I might be able to achieve this? I am using the Omega theme and can always fall back to using the Delta and Context modules for this, but I would rather not add that additional overhead to the site.

Thanks in advance for any help.

EDIT: I should add here that the main difference is that the More link in the view pane links to a Views Page with a contextual filter, so I am trying to figure out how to pass that GID argument to the Views page. Not sure that that was obvious.

r

See my note. Every panels

Bob Newby's picture

See my note. Every panels page, indeed every variant of a panels page, can embed multiple views panes.

Omega! Whew, you are a brave dude!

I use a commercial Adaptive theme. Adaptive's developer embraces panels. Jake is a superb developer (Omega). Yet unless something has radically changed recently, Omega does not embrace panels. It's lead developer has been known to express the opinion that Omega is "the right way to do things" and that panels is definitely "the wrong way". To each his own.

Cheers

Hear what you're saying

RKopacz's picture

I have actually had some early limited success with Omega, Page Manager and Panels. Only issue I've had is can't take over the front page with Page Manager in Omega 7.x-3.1, but was able to take over a basic node page. But I do hear what you are saying. I will have to research it more and will check out Adaptive Theme, so thank you for that lead.

I do love Page Manager's ability to pass an argument in the form of a node ID or Group ID to the views content pane or view context inside a panel. Nothing comparable in the Omega / Delta / Context Module layout solution, as far as I can see.

Incidentally, I was able to solve the specific issue I was asking about, although I am not sure it is the most elegant solution. If you have any suggestions as to where might be the best place to write that up in case anyone else would be interested in it, would love to share it with the community.

Layout

Bob Newby's picture

Before I forget, you CAN take over the front page with Page Manager/Panels.

Fyi, the LuthierBuilt.net site uses Adaptive Headliner for everything except admin paths. Also, I have barely tapped into utilizing CSS to customize various things, so don't infer anything from the site's relative lack of visual vibe, so to speak.

With Adaptive, there is a slew of responsive layouts to choose from and to use for any panels page variant, for any mini-panel, and for any panelized content (and perhaps entity bundle) type.

I really fail to see anything Context-driven Delta with Omega can accomplish that cannot be accomplished using CTools-driven Page Manager/Panels/Panelizer with Adaptive. As you have already noted, the combination is actually more powerful.

Referencing my main note, context is available to every single item and kind of display pane within a layout region, not just to the overall page. Ditto regarding styling be it using CSS, Stylizer, etc.

Cheers,

Bob

Keep it simple - Use a views pane as panel's page content

Bob Newby's picture

Everything in the page manager and panels ecosystem is designed the way they are for a reason:

A panels page is made up of layout regions
-- A layout region is made up display panes, and a pane can be
---- A custom or reusable content pane
---- A mini-panel
---- A views pane
---- A block
---- ETC

A views pane is a display variant for the view in question, just as a block and a page are display variants for the view. A views pane has no path.

So, you just need to enable the associated page manager/panels module in order to be able to create views panes.

Keep in mind that all of the following are reusable components:

-- A resusable content pane
-- A mini-panel (it has its own layout regions, display panes, and displayed content)
-- Each display of a view, including views pane displays

There is absolutely no need for panels fields and Context. (IMHO, Jason's suggestion is very convoluted.) As everyone who uses page manager and panels knows, panels understands context. It is really CTools that understands and supplies context; it is underneath page manager and panels.

To see this in action, visit LuthierBuilt.net. Specifically, see:
- https://luthierbuilt.net/main/site-search
- https://luthierbuilt.net/magazine
- https://luthierbuilt.net/blogs
- https://luthierbuilt.net/professionals
- https://luthierbuilt.net/professionals/map
- etc.

This approach maintains a clear and flexible and highly-maintainable separation-of-concerns, which is what any good architecture needs.

Best wishes,

Bob

ETC

Bob Newby's picture

The ETC in my original note about what a display pane can be includes a veritable slew of Drupal components. I would need to use a high-res screen capture to make this clear. The screen capture would impress almost anyone who does not have Panels experience.

Among these are NODES, where the display mode to use can be selected from whatever is available for each node's content type.

@Bob Newby: have you found a

pmackay's picture

@Bob Newby: have you found a way to capture a reusable panel pane in Features? I havent and this makes them less reusable.

Features is flaky

Bob Newby's picture

Hi Paul,

IMHO features is flaky. I don't use it. (D8 implemented what Features was aiming at the right way. It's a totally different animal; true configuration management via files of formal directives that reside outside the live DB.)

With the CTools / Page Manager / Panels ecosystem on D7, the following are exportable and importable, such that they can be reused across sites, including across one site's DEV/TEST/LIVE environments:

  • Custom content panes [1]
  • Mini-panels [1]
  • Page Manager pages [2]
  • Panels [2]

Note [1]: These are reusable components within a site, by definition.
Note [2]: Variants of these can be reused within a site by exporting then importing and renaming them (as with Views - no surprise, as Views is also built on CTools).

So, I fail to see how this paradigm is less reusable than what Features attempts to offer. I see it as more reusable -- with 100 percent predictability and reliability.

@ Bob Newby or anyone - in D7

juc1's picture

@ Bob Newby or anyone - in D7 I have a node template with about 20 variants - can I export the entire template ie all variants together to another site ie one export / import or can I only export one variant at a time ie needing 20 different exports / imports?

Thanks...

Glossay views using panels

gottaknow's picture

I have a glossary which displays the fields I need in a table with sorting and all that good stuff. I can't get glossary to work without defining a page as the 'attachment' ABC when selected loads the results on the same page.
Besides this table on the page I want other stuff so panels would be great to handle the rest of the page.
It doesn't work but why is there a override URL in panels? Would be great to be able to override a view for a panel. A bit of an overkill but not sure how to get glossary working without a page defined.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: