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
Comment #1
merlinofchaos commentedI 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. :)
Comment #2
pcorbett commentedThanks 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.
Comment #3
merlinofchaos commentedIt'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.
Comment #4
pcorbett commentedAgain, 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.
Comment #5
merlinofchaos commentedI 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.
Comment #6
pcorbett commentedGreat, thanks for the direction. I'll let you know where we end up!
Comment #7
balintbrewsI 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.
Comment #8
dddbbb commentedThe sandbox module mentioned in #7 works great. I think it should be a proper project. Many thanks!
Comment #9
damienmckennaI'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.
Comment #11
aaronbaumanrelevant, for anyone stumbling on this: https://www.drupal.org/project/views_contextual_filter_query