Is it possible to provide an optional querystring context to a Panelizer node? With Panel Pages, it seems straight forward by adding an optional !query at the end of the page's URL path (e.g., panelpage/!query), but with Panelized nodes, the !query is not a an option/argument to add as a context.

My ultimate goal is to use the apachesolr_panels module, but it needs to have part of the URL passed to it in order to display search results inside a given pane.

Comments

merlinofchaos’s picture

I guess what you'd have to do is to write a context plugin that can create the proper context and pull it from the querystring. Such a context plugin shouldn't actually be that hard. And doing so would probably make an interesting blog post. :)

pcorbett’s picture

Thanks for the prompt reply Merlin! Would this be a ctools plugin or specific to Panelizer? The panel page's treatment of !optional_argument into a String context is essentially what I'm looking for. I'll start looking into it but any direction is much appreciated.

merlinofchaos’s picture

It'd be a CTools plugin of type 'context'.

In Page Manager, the !optional_argument works on the URL. However, Panelizer doesn't really technically have access to URL arguments, so getting that data into the contexts is a lot harder. While it might be possible to try to add some kind of argument processing to do that, right now that's not on my planned features list. I'll bring it up with my clients who use Panelizer, though. If it's something they need then it could theoretically be added, with enough effort.

pcorbett’s picture

Again, thanks for the prompt response. It sounds like enabling the desired functionality is something that would take adjustments to the Panelizer module itself, and likely not be worth my time coding? If so, MY client is not quite as large as yours but still a big player. Our backup is to simply use Panel Pages (D6) and deal with the fact that they won't be indexed by Solr for now, however, they may be interested in sponsoring the development should you be interested. Let me know if building the plugin is worth the effort on my part and I'll get to work. I was planning on following the lead set in the ctools_plugin_example code.

merlinofchaos’s picture

I think for simple stuff it's really not very hard. What you'd be doing is creating a 'context' plugin that actually provides a different context, so the hard part might actually be visualizing what it is you want to do.

pcorbett’s picture

Great, thanks for the direction. I'll let you know where we end up!

balintbrews’s picture

I also would like to use some values from the query string as a CTools context, so I implemented the plugin what merlinofchaos described above:
http://drupal.org/sandbox/balint.kleri/1442298

Maybe it can be useful for you as well, it's for 7.x though.

dddbbb’s picture

The sandbox module mentioned in #7 works great. I think it should be a proper project. Many thanks!

damienmckenna’s picture

Issue summary: View changes
Status: Active » Fixed

I've suggested balintk's sandbox be submitted as a patch to CTools: #2198963: Submit as a patch for CTools?

Marking this one as fixed - lets focus on the sandbox and then CTools patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

aaronbauman’s picture

relevant, for anyone stumbling on this: https://www.drupal.org/project/views_contextual_filter_query