Advanced Dynamic Pages with Drupal Arguments and Panels

Advanced Dynamic Pages with Drupal Arguments and Panels

****Caution, this Drupal arguments and panels post assumes you have both panels & views installed and some basic working knowledge of both.**** Last week I published a little post on how you could create a dynamic page simply using views and arguments; today we’re going to take that one step further and get a little more advanced and toss panels into the mix. For this example I’m going to create a simple dashboard of various content types that I have tagged featured.
  1. Create a new view and start by adding some default information.
  2. Add a filter of Node: Published (Yes) unless you want to show content that has yet to be published.
  3. Add an argument of Taxonomy: Term
  4. Add a simple sort criteria like Node: Post Date (desc)
  5. Add a new display of your view as Content Pane
  6. Add basic identification information, and any other general information that will be specific to only this view pane.
  7. Add a new filter on a per-Content Pane basis depending upon what type of content you’ll be using for that pane, something like Node: Type (Video, Image, Story). Be sure to use only one type per pane unless you intend to blend content from different areas of the site.
  8. Add the appropriate fields you want to show, some might be titles and teasers, while others simply scaled image or lightbox link to a video.
  9. Adjust your Pane settings to include basic identification information. The key piece is the Argument Input, be sure to hit edit and select From panel argument. (Repeat this step for all of your views) We do that because we’re going to pass one argument through the panel that will be received by all of the views.
Once you’ve completed the needed steps for your views, you can then move over to creating your panel.
  1. Create a new panel and answer the basic questions for layout and so forth, be sure to include a path something like http://mysite.com/custom-panel/%1. The %1 is the argument that will be passed from the URL to each of the custom views you’ve already created.
  2. Once you hit save you’ll see an option to adjust the argument based on context, we could do that now but it’s an advanced option that we won’t touch on in this tutorial.
  3. Choose your layout (I prefer flexible as I can put panes anywhere)
  4. Give your page a title; it can be supplied by the argument if you input something like This is a panel about %1.
  5. Hit finish
  6. Click the small icon that looks like a cog above the section you’d like to add content and the hit add content.
  7. Select the Views Panes tab to see the views you’ve created and then place the appropriate view, override the title if you like.
  8. Repeat step 7 at the various positions across the panel until all of your views have been placed.
  9. Click Update and save
  10. Now visit http://mysite.com/custom-panel/featured and you should see the dynamic panel you’ve created.
Remember that you must tag any piece of content you’d like to display with the word featured or it will not show. In addition, you could use other tags and just change the URL string to something like http://mysite.com/custom-panel/my-tag and the Panel will only show content pieces tagged with My Tag.

Related Posts

Creating Dynamic Custom Pages with Views, Panels & Arguments

Chris Sloan
Read more

Custom Dynamic Pages with Drupal Arguments and Views

Chris Sloan
Read more

Ten Drupal Centric SXSWi Panels I'm Voting For

Colin
Read more

Leadpages Landing Pages and Thank You Pages - They're So Easy

Felipa Villegas
Read more

September Recap: LevelTen's Best Blog Posts

Colin
Read more

Creating Related Content Blocks: Side-by-side comparison of Blocks via Views vs Content Panes via Panels

Kristin Brinner
Read more