Found myself needing panels support for this module. This patch adds a pane (which requires a node context before being visible) that can be added to any panel. I use it for a node override panel containing content we wanted to share.

The block added to a panel is context agnostic and only plusones the base url. This pane uses the node context to create a plusone widget for the current URL.

Patched against latest released dev since I couldn't clone the project from git for some reason.

CommentFileSizeAuthor
add_ctools_pane_patch.txt2.69 KBSilicon.Valet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

corbacho’s picture

Thank you :), I will review it this weekend

corbacho’s picture

The patch is to create a plugin for Custom panes (part of CTools) if I understand right.

What are the adventages, compared to this solution I offered in other issue (adding Node Links or Node Content *with* Extra stuff checkbox)

Or adding a block (in the dev release I updated a new option to leave empty the field so the URL is dynamic, depending of the page)

Understand that I don't want to bloat the module if there are alternatives.

btw, I will be interested on make settings exportable with Ctools. Any thoughts about this? I suppose strongarm module is enough, no need for Ctools.

Thanks

Silicon.Valet’s picture

The patch creates a custom pane for the GooglePlusOne widget and allows you to use it in panels as a native object. This is the "panels/ctools way" to add a pane and the code is fairly straightforward.

Creating the pane gives you finer grained control over access, placement and context for the widget.

As a pane, you can place it like a block. You can change visibility, the node it plusones based on user, node or system context. As a pane, it's simpler to use for those familiar with panels.

Virtually all of the code for the panels compatibility lives in the plugins subfolders. Just a snippet to tell ctools to look.

I could take a look at making the module exportable, but I'm slammed for the next few weeks so it would take a while.

corbacho’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for some explanations. Still they doesn't answer my concerns ¿Is it so different from adding the block in your panel ?? I can control the placement/context, etc the same way, isn't it? Or please, explain your use case to bring more light into why is needed?

Your code is very straightforward because is using a very basic default option (a standard size-button, without URL, etc, etc.), but what about all the options that offer the Google+1 button block and admin settings page? The right way would be to implement those in the pane also.

Custom Panes plugins are so needed ? Is there any other "widget-modules" that offer Custom Panes plugins? I would say I'm familiar with Panels and CTools but I never used custom panes. I don't think is so popular this feature of Ctools.

Maybe I'm wrong. If others agree with this feature, I will consider again

I will prefer to concentrate energies by now for integration with Views,

Thanks and sorry if it sounds rude, I want to be direct, English is not my mother tongue.

Silicon.Valet’s picture

Hmm, maybe I muddied the water a little. This is a custom pane that is being created, but it's not a "custom pane" in the panels UI sense.

There are differing philosophies with regard to layout and configuration in Drupal. Some use blocks, some blocks with context, and some panels. Each has its merits, and each can be leveraged more fully by having additional support provided by the module. This patch adds panels support to the module.

No dependencies are added for this code. The hook isn't called if ctools isn't enabled, and therefore none of the includes are ever executed. The code for panels support is abstracted away and distinct from your core module from your perspective. I call the core module api functions and use core module variables.

If you do not want panels support, that is fine and I'll be happy just leaving this patch here for others to find. If you do, I'll add some additional configuration options to the pane to match what you have in the general and block settings (or, where appropriate use panels context to simplify) and re-roll a new patch.