Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using a sub-theme which has a header
region. However it is not working either in footer nor in header. It is displayed on the top of the node's body.
I also have a panel customizing a node type. This node type does not display +1 anywhere.
It would be very interesting if the admin could choose other places to insert +1. For example, in node titles.
Comments
Comment #1
corbacho CreditAttribution: corbacho commentedHi Mac,
The header / footer setting is about where to include the javascript file, it's not the button placement.
The button placement depends more about the weight (relative to node body) and the css. You can play with negative margins or position:absolute to make more "radical" placements.
I haven't tested with Panels but I know someone said in this issue queue about showing it in Panels through "node links". So try to enable this view mode in the settings of g.plusone.
btw, what Panels version are you using? I will try to test it during next days.
Comment #2
Mac_Weber CreditAttribution: Mac_Weber commentedI'm still think it would be interesting if admin could choose where the div would be inserted and using CSS just to do minor adjustments.
About Panels, I'm using 7.x-3.0-alpha3. I added a node link as you said, but it just displayed a normal link.
Comment #3
corbacho CreditAttribution: corbacho commentedI can't do anything else from a module. The degree of manipulation in the placement of the button that you want, demands that you print it yourself in the node.tpl.php
If you want to print it before
print render($content);
, just put this<?php print render($content['google_plusone']); ?>
If it's AFTER the content is printed, you will need to hide it first:
I will test it with Panels, soon I will report here.
Comment #4
BenK CreditAttribution: BenK commentedKeeping track of this
Comment #5
corbacho CreditAttribution: corbacho commentedI tested with Panels 7.x-3.0-alpha3.
There are different Panels types... I tested these two and both worked fine:
Panel node
Creating a "Panel node" it creates a new content type -> Enable it this content type in Google Plus One settings and that's all.
Panel page
For this you need the Page Manager enabled, this sub-module of Panels requires Ctools (Tested with 7.x-1.0-beta1)
Then I did this:
* go to admin/structure/panels
* Under "Manage pages" enable "Node template" then click on edit link
* Click on the "Add a new variant" link
* Name it, select Panel and didn't check anything else there
* Select a builder. Continue
* Continue Add Variant
* In the little cog -> Add content -> Node -> Node content (Other possibility is Node Links)
* Disable the checkbox Extra
* Update and save
Make sure that the view mode when adding the Node content in the panel matches with Google +1 Settings :
* Full content -> In google settings Full content
* Teaser -> in google+1 settings Teaser
* Node Links -> In google +1 settings Node Links
Please, report if it worked for you guys. I think the only difficulty was that "Extra" checkbox, easily can be overlooked. It says:
Comment #6
kscheirerNice follow-up, that sounds like it would fix the issue.