I use various modules to display share buttons on Views results (ie. Tweet Button, Facebook Social Plugins, LinkedIn Button), and would love it if it was possible to make Google's +1 button available as a Views field.

Comments

corbacho’s picture

It's a good idea, I will welcome patches for this integration, if not I will do it by September after holidays

fm698’s picture

can you provide us how to integrate (ie. Tweet Button, Facebook Social Plugins, LinkedIn Button) to views :)

manoloka’s picture

subscribe

vanvemden’s picture

+1

manoloka’s picture

not only as view field but to show up in any views as usuall

laraz’s picture

subscribe

ratinakage’s picture

subscribe

steeph’s picture

subscribing

steeph’s picture

For now I'm using a "Node: Path" field and rewriting it's output with the +1 button code. The script is placed in the views header. You can use http://www.google.com/webmasters/+1/button/ to generate code for the button you want.

odizle’s picture

subscribing

jorditr’s picture

Since last dev still doesn't provide integration of the G+1 button to views I've tried to implement it as #9 is suggesting, but with no luck.

I've added a field path which I've rewritten:

<g:plusone size=”medium” href=”http://domain.com/[path]“></g:plusone>

and added that script on a views header (with full HTML display):

<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

But it doesn't work. What else is required, since the header of the page already includes the google scripts and meta (the module is installed and displaying properly the button on the node links area)??

Thanks!

steeph’s picture

Version: 6.x-1.0-rc8 » 7.x-1.x-dev

My rewrite text is <div class="g-plusone left" data-size="small" data-href="[path]"></div>

My views header is the same as yours.

jorditr’s picture

Wopss!!! :-) Your rewritte works! Thanks steeph!!

steeph’s picture

Don't forget to add the domain name to the data-href, as in your examplecode. It will probably work without one, but then your visiters will +1 e.g. "/node/23" instead of "http://example.com/node/23".

jorditr’s picture

Thanks :-)

corbacho’s picture

I was thinking to make google plus one field-able for D7. This would make automatically compatible with Views I guess.

See how Tweet Button did it
http://drupal.org/node/884830

I don't have time so much now, so it will take time. But if anyone is willing to jump in and create a 2.x branch and maintain it, I will be glad to have a co-maintainer for this module.

Anonymous’s picture

Issue summary: View changes

Following