Hi,
I installed your module and it is working nicely in nodes displayed the conventional way. However when I display nodes using panel to arrange and display the field content (mainly to present the content in a better way) the plus one does not show up in the link section. It would be nice if we could have the plus 1 button show up as a block or in the links section of the content so it can be displayed when panels are used to style the nodes.

Comments

CarbonPig’s picture

Subscribe - a block would be awesome for maximum flexibility!

CarbonPig’s picture

FYI - I figured out a way to add the plus one button to a block, but you don't need the google plus 1 module (Please don't think I don't love the idea of a module - Ijust needed it in a block)

You can see an example on this page about Eco Transport.

Here's how I did it:

I went into my theme and added the google recommended snippet into the page.tpl.php file like this:
at the very end of the file...


        </div><!-- /footer-message -->
      </div><!-- /footer-message-wrapper -->

    </div><!-- /page-inner -->
  </div><!-- /page -->
  <?php print $closure; ?>
  <b><script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script></b>
</body>
</html>

Then I created a block with the google snippet containing:


<g:plusone size="tall"></g:plusone>

Make sure it is on full html.

and it worked - now all of my pages with that block are showing the plus 1!

You can grab the google code and customize the button here: http://www.google.com/webmasters/+1/button/

Hope this helps someone else who wants a "light" version of this module.

I know there are more standard ways of implementing java as described here: http://drupal.org/node/304255

However, that page didn't make a lot of sense to me : )

Cheers,

CarbonPig

The example: Eco Transport Article with Google + 1 button

corbacho’s picture

@santam with the new version (much more complete) 7.x-1.0-rc2 I have added a block (to show a fixed URL in all the site) and also the possibility of showing the button on the Node Links section.

I didn't update the 6.x branch with the new changes, but tomorrow probably.

@CarbonPig
Yeah, it's very valid way of doing it and fits in some use cases. I plan to document it .. for developers who don't want to add the overhead of adding "1 module more"

(You don't need to wrap the script with < b > tags, though)
Notice that when you don't indicate the href attribute in the button, Google +1 script will take the current URL that you have in that moment in the browser.

But what if ...
* you have a list of node teasers in the frontpage? Each one has its own URL.
* there are pages like admin pages where you don't need the plusone.js file.. but you are adding it in *every* single page.
* You have a multi lingual site
* You want the button inside of the node .. not as separate block
That and other cases, are covered by this module.

santam’s picture

Version: 7.x-1.0-beta4 » 7.x-1.0-rc2

Thanks for the quick update. I uninstalled and installed the new updated module. While it shows up in the links section it doesnot work. Clicking on it makes it turn red with an exclamation mark. My website is here www.isocenter.org . I will try carbonpig's method and report back if that worked.

santam’s picture

Interestingly the solution proposed by carbonpig is working. Is there anyway I can help you troubleshoot the problem I will be glad to help.

corbacho’s picture

Thanks, I think now is fixed. Could you download the rc3 module to test if it works?. To make it faster, for this update you can just replace the module, no need to disable it first. There was a bug (only in rc2 module) at grabbing the node alias.

CarbonPig’s picture

Hi @santam and @corbacho

Interestingly enough you can remove the javascript from the page.tpl.php file and simply put the following in a block for the same result:

<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script><g:plusone size="tall"></g:plusone>

However, the plus one button does not show up every time with either of the solutions I've proposed.

My guess is that some sort of pre-process needs to be done, but that is a bit beyond my ability.

When I sit and refresh my article pages, the button shows up about 40% of the time.

Any thoughts on others ways to get this going in a block on 6.x

Cheers,

CarbonPig

santam’s picture

Sorry for the delay in getting back on this issue. The plus one widget is working fine now and the plus ones are getting recorded. Thank you for the great support.

corbacho’s picture

Status: Active » Fixed

you're welcome.
btw, Now is ready rc4 version.. was a bug of incorrect HTML in case you are using the wrapper CSS option from the admin interface.

closing..

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