Closed (cannot reproduce)
Project:
Panels
Version:
6.x-3.7
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2010 at 20:32 UTC
Updated:
23 Oct 2011 at 12:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedPlease describe your use case; it is unlikely that display renderers are truly what you need, though there are some cases where this might be true. Generally, this is true only if you want to provide features similar to IPE, however.
Overriding the default behavior is possible, but it is not easy, because while the structure is in place, the UI to edit it is not, so any changes would have to be made by manually creating code that would ordinarily be created by the UI, if it were to exist. I'll give some pointers on how to do this if your use case matches, but I have a feeling I'm likely to advise you to a different solution, depending on what it is you're trying to accomplish.
Comment #2
cangeceiro commentedThanks for a quick reply merlin.
So I'll do my best to describe what I have so far. I've forked my own version of panels_nodes module that is pretty much the same, but panels has been abstracted from a specific node type as the ability to create a panel node needs to span across different node types. On the content side the panel content page needs to be exposed to several roles, but each role needs to have different features of the interface available to them. For example, role A needs to be able to move panel panes around, role b also needs to be able to add and remove panel panes, and role A and B should only see a particular category of panel panes to choose from. Finally admins should have the original panel content access.
I'm open to any suggestions you may have to accomplish this in a better manor. The approach at this point was to roll a custom version of panels_renderer_editor.class.php where permissions to controls could be handled
Comment #3
merlinofchaos commentedThere's an open feature request for this. If the code isn't too embarrassing it may be worth sharing. In the worst case maybe it's something someone else and clean up, and in the best case maybe it's something we can use as is.
And reading this...you're right. That's exactly the use case that the renderer plugins are being designed for.
So, as I said before, the UI for actually setting this stuff up hasn't been done. That said, take a look at panels_ipe/includes/panels_ipe.pipelines.inc
That's a standard defaults for the renderer pipeline exportable, which is partially implemented. You can use that like you would variants. It contains a list of renderers (currently that contains exactly 1). It will go through them one by one, checking to see if the user has permission to use it. If yes, it will render with that display renderer. If not, it will continue down the line. If all options are exhausted, it will proceed to the the 'standard' renderer.
You can then create custom renderers that do what you want. I would think you would want to start with panels_ipe renderer as a starting point, as that will give you a better idea of how to do limited/custom functionality, but you can start with the editor as well. You don't need to clone the editor, instead you want to derive from it like the IPE does and then override the functionality you want to change.
Right now, this only works for the actual display of the renderer. The 'back-end' is still hardcoded to standard. However, since you've got your cloned version of panel_node, you have the ability to control which renderer is used for the back-end as well, and you can pretty much just choose in code rather than using a pipeline.
I'd really love it if you'd share what you produce out of this. Even if we can't use the code directly, some of it may provide a basis for future code, since all of this is precisely where we intend this stuff to go when it's fully matured.
Comment #4
flevour commentedInteresting even if seemingly too custom approach, I'll keep an eye on this.
If I understand correctly it will be orobably worth sharing as sample code rather than official module/component.
Keep up the good work,
Francesco
Comment #5
cangeceiro commentedOk, the info above was a great help. I don't think it would take much to clean up the forked panel nodes module at all. So i would have no problem sharing that back, as I had also planned on doing a little write up on what was done as well for my blog since there isn't alot of documentation on the web about working with display renderers. But, I'll have to wait till im done on this project before i can get to cleaning it up and posting it :)
So i am at a point now where i can override the content page's pipeline and specify whatever renderer that I want. This is working well. And if i look at the pipelines on the node edit page, my pipeline shows up as an option. But the renderer is not getting recognized on the edit page. My suspicion is that something that needs to be included is not there. This conclusion came from getting a call to undefined function panels_get_renderer_pipelines() when I was doing some testing.
Here is what I got so far in my page function for the panel content page where 'custom_editor' is the new display renderer that has been created.
Once again, thank you for your assistance
Comment #6
merlinofchaos commentedpanels_get_renderer_pipelines() is in plugins.inc I think, so you probably just need:
(Note also that panels_laod_include() is deprecated and you should use ctools_include() as above in its place).
Comment #7
cangeceiro commentedWell it looks like the problem ended up being in hook_ctools_plugin_directory(). i had if ($module == 'ctools') { when i actually needed if ($module == 'ctools' || $module == 'panels') { so my display renderer is up and going now. Your help has been greatly appreciated, after this project is done i'll post what i have back to this thread.
Comment #8
cangeceiro commentedok, i might have spoke to soon. It appears that there is an inconcistancy causing a problem with hook_ctools_plugin_directory()
when i use
regular panel pages work, but my custom panel content page is broke.
the following:
Allows the custom panel content page to render correctly, but panel pages also use the custom editor on their display.
Any suggestions?
Comment #9
merlinofchaos commentedThe only way panel pages should be using the custom editor is if you have somehow overridden the association of the standard pipeline. It has nothing ot do with the plugin directory hook.
Comment #10
cangeceiro commentedok i figured this out, its my own damn fault. so i apologize for wasting your time on that last one.
Comment #11
cangeceiro commentedhere is my fork of the panels_node module that abstracts it from the panels node type. I don't think it could be considered production, but it is functional. The display renderer is hardcoded to the custom one i developed as well. One glaring flaw I noticed however. When using the content pane type "Node content" it creates a double render for anything added by any modules that append data to $node->content in hook_nodeapi.
Comment #12
zilverdistel commentedSubscribing, I'm trying something similar. I want to provide our end-users with a more simple interface for editing the content in the panel node panes. For now, this issue seems to be the greatest help available on doing this.
Comment #13
Letharion commentedIn an effort to clean up the many hundreds of open issues in the Panels queue, I'm going over all issues with the "Postponed, needs info" status.
As per the Panels Issue guidelines, http://drupal.org/node/573062 section 2.2, I'm closing all issues that haven't been updated during the last month.
I realise that some issues will be closed, that should remain open. In these cases, most of the time, they have simply been left in the "Postponed, needs info" state by mistake.
If this is the case, and you still have an interest in this issue, please just re-open it, setting the appropriate status.
Also, since this issue seems to revolve around Panel Nodes, please see the new Panelizer project, which may be useful if you find this issue interesting.