Everything In Between

The brutally honest, first-person account of Meitar Moscovitz's life.

Inline Google Spreadsheet Viewer

72 comments

A WordPress plugin that renders a published, public Google Spreadsheet in a WordPress post or page. Use this plugin? Please consider making a small donationprojects like these are literally my main source of income. Thanks!

Embeds a published, public Google Spreadsheet in a WordPress post or page as an HTML table.

  • Requires at least: 2.7
  • Tested up to: 3.3.2
  • Stable tag: trunk

Description

Fetches a published Google Spreadsheet using a [gdoc key=""] WordPress shortcode, then renders it as an HTML table, embedded in your blog post or page. The only required parameter is key, which specifies the document you’d like to retrieve. Optionally, you can also strip a certain number of rows (e.g., strip="3" omits the top 3 rows of the spreadsheet) and you can supply a table summary, <caption> and customized class value.

For example, to display the spreadsheet at https://spreadsheets.google.com/pub?key=ABCDEFG, use the following shortcode in your WordPress post or page:

[gdoc key="ABCDEFG"]

Currently, this plugin only supports Google Spreadsheets that are “Published as a web page” and therefore public. Private Google Docs are not supported (yet).

To render the HTML table with additional metadata, you can also do the following:

[gdoc key="ABCDEFG" class="my-sheet" summary="An example spreadsheet, with a summary."]This is the table's caption.[/gdoc]

The above shortcode will produce HTML that looks something like the following:

<table id="igsv-ABCDEFG" class="igsv-table my-sheet" summary="An example spreadsheet, with a summary.">
    <caption>This is the table's caption.</caption>
    <!-- ...rest of table code using spreadsheet data here... -->
</table>

You can use the gid attribute to embed a worksheet other than the first one (the one on the far left). For example, to display a worksheet published at https://spreadsheets.google.com/pub?key=ABCDEFG&gid=4, use the following shortcode in your WordPress post or page:

[gdoc key="ABCDEFG" gid="4"]

The header_rows attribute lets you specify how many rows should be rendered as the table header. For example, to render a worksheet’s top 3 rows inside the <thead> element, use:

[gdoc key="ABCDEFG" header_rows="3"]

Installation

  1. Upload inline-gdocs-viewer.php to the /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Use the [gdoc key="ABCDEFG"] shortcode wherever you’d like to insert the Google Spreadsheet.

Frequently Asked Questions

The default style is ugly. Can I change it?

Yes, if you’re able to change your theme’s style sheet. The plugin renders HTML with plenty of CSS hooks. Use the igsv-table class from your style sheets to target the plugin’s <table> element.

Additionally, each row (<tr>) and cell (<td>) is assigned a specific class attribute value. The first <tr> element is assigned the row-1 class, the second is assigned row-2, and the last row-N where N is the number of rows in the rendered table. Similarly, each cell is assigned a class based on its columnar position; the first cell in a row is assigned the col-1 class, the second col-2, and so on:

.igsv-table .row-2 .col-5 { /* styles for the cell in the 2nd row, 5th column */ }

Finally, both rows and cells (based on columns) are assigned an additional class of either odd or even, allowing for easy zebra-striping in CSS3 non-conformant browsers.

.igsv-table tr.odd  { /* styles for odd-numbered rows   (row 1, 3, 5...) */ }
.igsv-table tr.even { /* styles for even-numbered rows  (row 2, 4, 6...) */ }
.igsv-table td.odd  { /* styles for odd-numbered cells  (column 1, 3, 5...) */ }
.igsv-table td.even { /* styles for even-numbered cells (column 2, 4, 6...) */ }

A table appears, but it’s not my spreadsheet’s data! And it looks weird!

You should triple-check that you’ve published your spreadsheet. Google provides instructions for doing this. Be sure to follow steps 1 and 2 in Google Spreadsheets Help: Publishing to the Web.

Can I remove certain columns from appearing on my webpage?

While you can’t strip out columns like you can do with rows, you can hide columns using CSS with code such as, .col-4 { display: none; }, for example.

Change log

Version 0.3

  • Implements header_rows attribute in shortcode to allow rendering more than 1 header row.
  • Fetches data using wp_remote_get() instead of fopen() for portability; now requires WordPress 2.7 or higher.
  • Updates plugin internals; uses PHP 5.3′s str_getcsv() function if available.

Version 0.2

  • Implements gid attribute in shortcode to allow embedding of non-default worksheet.
  • Updates plugin internals; now requires WordPress 2.6 or higher.

Version 0.1

  • Initial release.

Written by Meitar

August 17th, 2010 at 1:02 am

Posted in

72 Responses to 'Inline Google Spreadsheet Viewer'

Subscribe to comments with RSS or TrackBack to 'Inline Google Spreadsheet Viewer'.

  1. How should I use strip=”3″ ?

    Is it [gdoc key="ABCDEFG" strip="3"] ?

    And is there a way to show only the top rows, e.g. show the first two rows?

    handig

    23 Oct 10 at 1:28 PM

  2. Is it [gdoc key="ABCDEFG" strip="3"] ?

    Yup. :) TIAS.

    is there a way to show only the top rows, e.g. show the first two rows?

    Not yet. But that’s a fine idea. :) Patches welcome!

    Meitar

    24 Oct 10 at 9:56 AM

  3. I tried strip as in :
    [gdoc key="ABCDEFG" strip="3"] but that doesn’s strip anything? Using the latest WordPress (multisite config).

    handig

    24 Oct 10 at 2:19 PM

  4. I tried strip as in :
    [gdoc key="ABCDEFG" strip="3"] but that doesn’s strip anything? Using the latest WordPress (multisite config).

    I’m sure that it does, as I’m using that parameter on my sites, but I believe that you’re having trouble with it. You may consider double-checking that there aren’t any empty rows in your Google Spreadsheet that are being stripped out.

    Unfortunately, I can’t troubleshoot your issue for you. If you’d like to report a bug, feel free to submit an issue.

    Meitar

    26 Oct 10 at 4:48 PM

  5. LS
    Any reason why this key wouldn’t work?
    [gdoc key="tKGnpi2W1kHafUIQOwRsfMQ&hl=nl&authkey=CNvkgKMB#gid=0"]
    that’s how the spreadsheet named in my browser. Language should be omitted? Wrong configuration of WordPress?

    Thanks,
    Pim.

    pmarsman

    30 Nov 10 at 2:22 PM

  6. That’s not a key, pmarsman, that’s a query string. Your key is probably tKGnpi2W1kHafUIQOwRsfMQ. If my inference is correct, you want to use this:

    [gdoc key="tKGnpi2W1kHafUIQOwRsfMQ"]

    Meitar

    1 Dec 10 at 6:24 PM

  7. Thanks Meitar.
    I didn’t know I had to publish the document to the web: that button is in the right corner of the documentscreen in pull downmenu sharing. I usually share document via another links just besides the title.
    In the end I used “TGN embed everything” plug in because it also allows me to embed privatie gDocs, and to embed youtube en other pages via iFrame.

    Thanks,
    Pim.

    pmarsman

    2 Dec 10 at 1:16 AM

  8. I am trying to edit the column spacing. Currently there is no spacing between the columns. could you please tell me how to do this?

    adam

    30 Dec 10 at 11:24 AM

  9. I am trying to edit the column spacing. Currently there is no spacing between the columns. could you please tell me how to do this?

    Try using left and right padding on the cells themselves. To space the second column out from the first and third, for instance, this might work:

    .col-2 { padding-left: 3em; padding-right: 3em; }

    Meitar

    2 Jan 11 at 2:01 PM

  10. Hi Meitar

    It’s a great achievement to be able to use Google inline viewer in my blog – I just hope that you will make another plugin for Google Calender. Do you think it would be possible ?

    Steen Jakobsen

    19 Jan 11 at 12:10 AM

  11. Hi Steen. :)

    I…hope that you will make another plugin for Google Calender. Do you think it would be possible ?

    Well, Google Calendar is pretty easily embed-able within any HTML page. See the Google help page about embedding a Calendar view in a web page. I’m unsure what a plugin would do that isn’t already possible with the free Google Calendar embed code. Can you let me know what you were hoping to accomplish that you can’t accomplish simply embedding the Calendar into your HTML pages?

    Thanks. :)

    Meitar

    19 Jan 11 at 2:23 AM

  12. Hi Meitar

    First of all, thanks for your reply. I didn’t know that I could embeb a Calendar and I wonder why I needed to have a plugin for the spreadsheet and not for the Calendar.

    Thanks,

    Steen

    Steen Jakobsen

    19 Jan 11 at 2:29 AM

  13. Hi there

    Many thanks for writing this plugin!
    My question is, is it possible to strip out a column like you can do with a row? If so, how do you do it?

    Thanks

    Joe

    Joe

    3 Feb 11 at 6:04 AM

  14. is it possible to strip out a column like you can do with a row? If so, how do you do it?

    The plugin doesn’t have an option for it, but you can use CSS to achieve that effect. For instance, the following CSS rule will remove the fourth column from the page.

    .col-4 { display: none; }

    Hope that helps.

    Meitar

    3 Feb 11 at 7:16 PM

  15. Html links in my spreadsheet are not appearing. Is this a know error or is something wrong. I can see the links when viewing the google docs but nothing appears in website view

    Steven Miedema

    8 Feb 11 at 7:58 AM

  16. Html links in my spreadsheet are not appearing. Is this a know error or is something wrong. I can see the links when viewing the google docs but nothing appears in website view

    This plugin doesn’t operate on any of the data inside the cells, Steven, which is why you aren’t seeing the URL‘s appear as hyperlinks. That’s a good feature request though, because it’s a pretty safe operation, so I’d appreciate it if you can submit an issue to this effect on the issue tracker. :)

    Meitar

    8 Feb 11 at 4:57 PM

  17. Hi Meitar. Love the plugin, thanks. Would like also to have URLs working, as above. I’ve added it to the issue tracker as requested. Thanks, Stuart

    Stuart Wales

    25 Feb 11 at 9:02 AM

  18. I am trying the plugin. I created a public spreadsheet, but it’s not appearing on my page.

    Here’s the public address:

    https://spreadsheets.google.com/ccc?key=0AhUtMNvdXelwdEFORFVqQ3RtaVZXdG5LUmstMG8tdlE&hl=en#gid=0

    Here’s the page where the shortcode is:

    http://sandbox03.veloware.net/class-schedule-university-elite-fitness-taekwondo/

    Here’s the shortcode:

    [gdoc key="0AhUtMNvdXelwdEFORFVqQ3RtaVZXdG5LUmstMG8tdlE"]

    Thank you for your help.

    Julian

    3 Mar 11 at 4:40 PM

  19. You don’t appear to have published your document, Julian. See Publishing to the Web at Google Help.

    Meitar

    3 Mar 11 at 5:51 PM

  20. I love this plugin.
    Any reason why an update to a published sheet would not display?
    Seems to only show the original state when I first published.

    Brian

    20 Mar 11 at 4:17 PM

  21. Any reason why an update to a published sheet would not display?

    Nope, Brian, no reason as far as the plugin is concerned. The plugin merely fetches whatever the most recent version is, as published by Google. Sometimes Google Docs does take a few minutes to refresh the published-to-the-web version of a “published” document, though. That may be what’s happening.

    In the future, I would like to see the plugin itself keep a cache of that “most recent” version, but as that’s not yet implemented, that can’t be the explanation for why you’re not seeing the most recent version of your spreadsheet when using the plugin.

    Meitar

    20 Mar 11 at 5:18 PM

  22. Is it possible to display clickable multiple sheets?

    ed

    28 Mar 11 at 7:04 PM

  23. Great plug-in!

    Is there a way to select which colummns are displayed? I hid columns using css, but the data is still visible in the source code.

    Could I alter the php to only select columns I specify?

    Brenda

    1 Apr 11 at 1:43 PM

  24. I’m trying to display one sheet, and using
    key=”axxxxxxxx” gid=2], but I’m not getting the spreadsheet (it’s actually a lot of junk from google’s website that shows up). I’ve also tried gid=”2″ – doesn’t make a difference. How do I display a specific sheet? I must be missing something here. Thanks.

    Mike Quinn

    11 May 11 at 9:24 AM

  25. Is it possible to display clickable multiple sheets?

    Not with this plugin yet. Patches welcome. :)

    Could I alter the php to only select columns I specify? Is there a way to select which colummns are displayed? I hid columns using css, but the data is still visible in the source code.

    If you’d like to change the PHP yourself, sure, go ahead. For now, CSS is what one’s got, and arguably all one should have.

    I’m not getting the spreadsheet (it’s actually a lot of junk from google’s website that shows up)

    Make sure the spreadsheet has been published.

    Meitar

    11 May 11 at 2:54 PM

  26. Thanks for responding, Meitar.

    Brenda

    11 May 11 at 7:10 PM

  27. Hi,

    Love the plugin! Does it support template tags, or only shortcodes?

    Thanks!

    Travis

    26 May 11 at 11:11 AM

  28. Love the plugin! Does it support template tags, or only shortcodes?

    Not yet, Travis, but that’s probably a good feature to add. :) Patches welcome or, barring that, submitting this as a feature request on the Github Issue tracker for the project. Thank you!

    Meitar

    27 May 11 at 7:23 PM

  29. I am trying to embed a subscriptions page which includes currency – see the published page here:

    https://spreadsheets.google.com/spreadsheet/pub?hl=en_GB&hl=en_GB&key=0AumoeWGVsnHrdHRjN3JZZVozamNBOW96RTFQekEtbGc&single=true&gid=0&output=html

    But when displaying on the webpage it appears without a currency symbol as is evident here:

    http://irsociety.info/subscriptions/

    Sorry the web pages are still in development…

    chris

    31 May 11 at 8:20 AM

  30. Again commenting on the above – it seems to like dollar signs but not pound signs ??

    chris

    31 May 11 at 10:36 AM

  31. Hi Chris. You described an issue like this:

    when displaying on the webpage it appears without a currency symbol […] it seems to like dollar signs but not pound signs ??

    This is a frustrating problem because the problem is part of PHP‘s mishandling of certain characters when they are in the first position in a new CSV cell and there is a mismatch between the current locale setting on your server and the character encoding in the file being read. If your server is running in, say, en_US.iso88591 but your file is encoded in, say, en_GB.utf8, then fgetcsv() (the native PHP function this plugin uses) will read local character symbols (like the GBP symbol, £) incorrectly when it is the first character in a new cell. See, for instance, this report of the problem as well as this one on a PHP user’s board.

    Now, one way to solve the problem is to find out which character encoding your spreadsheet uses (I looked for you; it’s currently en_GB.utf8), then find out which locale your PHP is currently running in (I can’t check this for you, but you can invoke setlocale(LC_CTYPE, “0″) to find out for yourself), and then make sure they match. This is a bit more work than I’m willing to put into the plugin right now, although you’re more than welcome to submit a feature request on the plugin issue tracker to this effect.

    Another workaround might be to surround the values in your spreadsheet in quotes so that the currency symbol isn’t the first character in the cells, and then strip or hide those quotes from your actual web page.

    Meitar

    31 May 11 at 12:09 PM

  32. Hi! I would like to use my table with only the 1,2,3 columns. Can I do it with this plugin? Thanks your help! The plugin is great! :)

    adri

    24 Jul 11 at 8:48 AM

  33. Hello,

    I have been using your plugin for development of a site locally and it works great but once I moved the site live I now get this error.

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /***/inline-gdocs-viewer.php on line 44

    Warning: fopen(https://spreadsheets.google.com/pub?key=0AhCN3DNjYldMdC1HTDVEZXZxemI1X1FXcTRWb1pyZXc&output=csv) [function.fopen]: failed to open stream: no suitable wrapper could be found in /***/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php on line 44

    Any ideas on how to fix would be greatly appreciated.

    Thanks,
    Todd

    Todd

    26 Jul 11 at 2:02 PM

  34. I would like to use my table with only the 1,2,3 columns. Can I do it with this plugin?

    Adri, use CSS to hide any columns you don’t want visible.

    I have been using your plugin for development of a site locally and it works great but once I moved the site live I now get this error.

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /***/inline-gdocs-viewer.php on line 44

    Warning: fopen(https://spreadsheets.google.com/pub?key=0AhCN3DNjYldMdC1HTDVEZXZxemI1X1FXcTRWb1pyZXc&output=csv) [function.fopen]: failed to open stream: no suitable wrapper could be found in /***/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php on line 44

    Any ideas on how to fix would be greatly appreciated.

    You need to change the configuration of allow_url_fopen in your php.ini file, Todd.

    Meitar

    26 Jul 11 at 3:31 PM

  35. Got it working on my site, thanks a lot! It does what it is supposed to do. Even if your doc is public you need to share it as a webpage or it won’t work. But after I did that it worked fine and looks good with the CSS too. Awesome.

    Jacob Schweitzer

    27 Jul 11 at 1:25 PM

  36. Hi Meitar,

    Thanks for the help on the fopen, it works great now. I have one more question. Is there any way to make the spreadsheet columns sortable? Thanks!

    - Todd

    Todd

    27 Jul 11 at 4:36 PM

  37. I need to be able to use one big google spreadsheet (one column and 1000++ rows). Is there a way to narrow the displayed table to only cells containing specific words? What if I need to display results for a few different words?

    Amanda

    31 Jul 11 at 6:55 PM

  38. I love your plug-in. Our school just switched over to Google Apps for all staff/students. I am integrating it into the school website. Our athletics secretary has a multi-sheet spreadsheet with the schedules for every Fall Sport. I have a separate page for each sport schedule and tried including the gid to display only one sheet.

    For example, Girls Tennis: http://ehs.hbuhsd.edu/athletics/athletic-schedules/girls-tennis-schedule-all-levels looks like: [gdoc key="0Asfo0q9AvVdtdE9OekV3cFM0UW8tYkFqQlRBTmJDamc&single=true&gid=4"].

    and

    Field Hockey: http://ehs.hbuhsd.edu/athletics/athletic-schedules/fall-athletic-schedules/field-hockey looks like: [gdoc key="0Asfo0q9AvVdtdE9OekV3cFM0UW8tYkFqQlRBTmJDamc&single=true&gid=3"].

    Tennis has GID=4 and Field Hockey has GID=3. I published Field Hockey first and then when I published tennis, it changed the Field Hockey (GID=3) to the Tennis schedule (GID=4).

    How can I show separate sheets from the same spreadsheet without messing the other one up?

    haze

    12 Sep 11 at 5:10 PM

  39. doh. I got it. User error.

    I am having trouble with CSS. I want to style the tables a bit so every other row has a bg color and there are borders around the the table/cells. I tried “.igsv-table tr.odd { background-color: #xxxxxx; }” to no avail. Also, I couldn’t figure out what element (s) to add the border property to.

    haze

    13 Sep 11 at 6:59 AM

  40. I couldn’t figure out what element (s) to add the border property to.

    Here are a few guides to styling tables with CSS, haze. Good luck.

    Meitar

    13 Sep 11 at 12:53 PM

  41. Is there a way to give a spreadhseet/table a unique identifier for CSS?

    For example, we have Sport Schedules with several columns that we want to hide. All of our sports schedules have the same columns in the spreadsheet, so it was easy to .igsv .col-1, .col-8, .col-9, etc. {display: none; } to hide all of the columns that we didn’t need.

    However, we also have sports rosters, but they don’t have the same number of columns. So, my CSS is hiding columns I want to show for the rosters.

    Long story short, is there a way to designate .igsv#schedules and .igsv#rosters so that I can apply CSS only to certain ones?

    haze

    15 Sep 11 at 9:45 AM

  42. Hi Meitar,

    A great google spreadsheet importing plugin, thank you for your time and effort. I did have a question, but you’ve been kind enough to many users already!

    All the best,
    Chris, UK

    Chris

    21 Sep 11 at 3:05 PM

  43. Is there a way to give a spreadhseet/table a unique identifier for CSS? […] Long story short, is there a way to designate .igsv#schedules and .igsv#rosters so that I can apply CSS only to certain ones?

    Each spreadsheet already has a unique identifier, haze: the Google Doc “key” used to access it. These aren’t very human-friendly names, but they do distinguish one spreadsheet from another. So you might do #igsv-ABDCEF for “schedules” and #igsv-GHIJKL for “rosters”. Re-read the plugin description, above, to refresh your memory about how this works.

    A great google spreadsheet importing plugin, thank you for your time and effort. I did have a question, but you’ve been kind enough to many users already!

    You’re welcome, Chris. If you have a question, though, do ask. I can’t be kind and try to answer it if you don’t give me the chance to. ;)

    Meitar

    21 Sep 11 at 3:25 PM

  44. [...] found this cool plugin called Inline Google Spreadsheet Viewer By Mr. Meitar Moscovitz that lets you insert a Google Doc Spreadsheet into a Post or Page. The [...]

  45. I added on the page:
    [gdoc key="0AqnOsk5qBibQdEZ6RXFKZmpTMFJZWDBkYUNXMFNkWFE" gid="0"]

    but nothing gets displayed

    marko

    26 Nov 11 at 1:40 AM

  46. Hello Meitar,

    I installed this plugin on my fresh installation of WordPress (v3.2.1). Is this version not supported (Plugin page WordPress –> Compatible v.3.0.1)?

    I get the same problem as several other people mention. However, I published the sheet over the web.
    I implemented this code: [gdoc key="0AksW9-Ch9KqxdHFUS25EamtEd0kxRG1VbjB6d1pfY1E"]
    The link to the sheet is this: https://docs.google.com/spreadsheet/ccc?key=0AksW9-Ch9KqxdHFUS25EamtEd0kxRG1VbjB6d1pfY1E&hl=nl#gid=0

    What I am doing wrong?

    Thanks in advance!!

    Pedro

    12 Dec 11 at 4:44 AM

  47. Sorry, what I did not told you
    –> The page is mashed up with stuff of Google (with also a signup fields)
    http://wp.rockmedia.nl/?page_id=2

    Pedro

    12 Dec 11 at 4:47 AM

  48. Hi Meitar,

    I am getting the same error Todd was getting. Where can I find this php.ini page? I am not sure where to find it or how to fix it.

    Cheers

    Nadine

    Nadine

    19 Dec 11 at 6:06 AM

  49. I added on the page:
    [gdoc key="0AqnOsk5qBibQdEZ6RXFKZmpTMFJZWDBkYUNXMFNkWFE" gid="0"]

    but nothing gets displayed

    Dunno what to tell you, Marko. That’s not a lot to go on. At the very least, make sure you’re not hitting a cache of your website instead of the live site.

    Pedro, the URL you’re mentioning isn’t a public webpage. Be certain you’ve published your spreadsheet to the Web using Google Spreadsheets first.

    I am getting the same error Todd was getting. Where can I find this php.ini page? I am not sure where to find it or how to fix it.

    Nadine, the php.ini file is part of PHP itself. Read the manual to learn how it works and where it is likely to be on your system.

    Meitar

    19 Dec 11 at 3:24 PM

  50. Hi Meitar,
    Thanx for your response. I really do not understand what is going wrong. The document is Published to te web.
    I have made a screenshot of the Settings of this specific document. See: http://www.rockmedia.nl/googledocs.png

    Pedro

    19 Dec 11 at 3:40 PM

  51. Hi,
    I’ve got spreadsheet with merged some cells. Is there any possibility to view them correctly with Your plugin? Already they don’t show merged.

    greetings

    Karol

    26 Dec 11 at 12:06 PM

  52. I initially had problems as above because instructions are not quite right. Maybe Google changed the interface?

    What you need to do is: In File menu of spreadsheet (ie inside browser window) choose ‘Publish to the web …’ and click ‘Start Publishing’ button.

    I’m not sure whether sharing as described in instructions also needs to be set as ‘Public on the Web’ via Share button top right of spreadsheet. I guess there’s no reason not to.

    Note: I also had problems with a gid which was first created (ie gid=0) but then moved so no longer be left-most. Because of way plugin is scripted, gid=0 is ignored so defaults to left-most tab. Simply re-generated problem tab with another gid to work around.

    Plugin works fine so far with WP3.3 :-)

    Hope this helps. Big thanks to author!

    gggt

    29 Dec 11 at 5:29 AM

  53. I love this plugin!
    I would like to use it for the tournaments of a tennis school, but the html table i get has no background images of the cell, which i need for displaying the tournament brackets.
    I guess the issue is the theme css…
    Is there a way to override the theme css?
    [i'm not that wordpress/css monster...]

    Stefano

    1 Jan 12 at 10:35 AM

  54. Sorry, delete my previous post..
    now i’ve read of the igsv-table` class adn so on.

    i’ll try and maybe post something less dumb.

    [new_years_eve hangover mode: off]

    ciao!:=)

    Stefano

    1 Jan 12 at 3:37 PM

  55. Hello,

    On my website, fopen is locked by the supplier, so I change your code using wp_remote_get(). I also had to make the csv parser. if you have last php version you can use str_getcsv() otherwise….
    contact me if are interested into this update
    Thanks for your plugin, really usefull !!

    Tinken

    Tinken

    19 Jan 12 at 6:42 AM

  56. Hi Meiter!

    Apologies for starting this with a praise, but I just can’t help it! This plugin makes non-coders look like pros :)

    Nevertheless, a non-coder is still a non-coder.

    I’ve been trying to format the tables using css. I’ve prevailed in formatting the tables one-by-one using .igsv-table..

    However, is there a way I can implement this to all spreadsheets? I’m publishing a huge number of spreadsheets. I can format each table, but too cumbersome.

    Any help?

    thanks

    nick

    7 Feb 12 at 7:17 AM

  57. Dude, I think Google has changed something…. as your plugin doesn’t work anymore : /

    Bootypatrol

    10 Feb 12 at 12:22 PM

  58. this is probably a stupid question ..but here goes

    i have some conditional formatting in my google doc–basically red or green color based on values above or below zero.

    the colors are obviously getting stripped when send using this plugin.

    Anyone have any creative ideas on how to maintain formatting on the html?

    Thanks!

    chris

    25 Feb 12 at 9:11 AM

  59. Hmm..is anyone able to display something other than the first sheet?

    The plugin works perfect when i have a page displaying my first sheet like [gdoc key="*****"]

    but when i try to create another page with [gdoc key="*****" gid="1"] the table displays but is an embedded Google Doc page with a bunch of extra noise from Google.

    Anyone else encountering this?

    chris

    25 Feb 12 at 9:51 AM

  60. i want to thx author 4 this plugin and want to help others with adding css to your spreadsheets.

    here is how it looks when you add this css codes: http://dalokaysitesi.org/aidatlar

    if you have trouble with design of your tables,
    add your theme’s style.css theese lines (under wp menu theme editor)

    .igsv-table {
    border-collapse: separate;
    border-spacing: 1px;
    background-color: #CDCDCD;
    margin: 10px 0px 15px 0px;
    font-size: 8pt;
    width: 100%;
    text-align: left;
    }
    .igsv-table th {
    background-color: #E6EEEE;
    border: 1px solid #FFFFFF;
    padding: 4px;
    color: #3D3D3D!important;
    }
    .igsv-table td {
    color: #3D3D3D;
    padding: 4px;
    background-color: #FFFFFF;
    vertical-align: top;
    }
    .igsv-table .even td {
    background-color: #FFFFFF;
    }
    .igsv-table .odd td {
    background-color: #F0F0F6;
    }
    .igsv-table .row-hover tr:hover td {
    background-color: #D0D0D6!important;
    }

    Duo Bilisim

    14 Apr 12 at 4:59 AM

  61. Hi, thanks so much for creating this plugin!

    Here’s a test page which uses it (twice):

    http://managedaccountreview.com/offshore-foa/

    I think it looks great (thanks to you!).

    In order for me to get the graph to look like it is part of the same dataset, I created the page by using styled tables to “contain” three elements:

    spreadsheet 1 (upper left info)
    chart (created by jquery)
    spreadsheet 2 (lower, horizontal table)

    To get each spreadsheet to show their data correctly, on google spreadsheets I created mini-sheets such as this one (for the table #2):

    https://docs.google.com/spreadsheet/ccc?key=0Anlq07HbSPGkdGlxN3I1Q1JJV2hUVi1lTEpvSkhSTXc#gid=20

    So… here are my questions:

    1. I want to create different styles for spreadsheet 1 and spreadsheet 2. For example on spreadsheet 1 I want to align column 1 to the left and column 2 to the right. Is a way to modify your php file so that I have two plugins installed: IGSV-A and IGSV-B? This way I could write two sets of the igsv-table css.

    2. Any ideas on how to show negative numbers in red? (see the google spreadsheet which uses conditional formatting).

    3. I also want to eliminate the borders or cell spacing on the upper left spreadsheet but nothing I do seems to solve this. Any suggestions?

    Thanks much!

    walter

    18 Apr 12 at 9:12 AM

  62. Again, thanks for this plugin! I love it and use it for every one of my sports related websites. By far the easiest way to to add stats in a “pretty” manner.

    Thanks to Duo for sharing his table styling for everyone to use. I actually liked it so much that I replaced one of my own styles with yours!

    My question, is there a way to display a range of cells. I know the top rows can be stripped, but I am searching for a method to display a range.

    As I mentioned, I have a sports site. I track and list some stats for the entire season. It would be nice if I could keep only one spreadsheet with the days as rows, then display only the most recent rows, rather than create a new spreadsheet for only a small selection of data.

    Travis Pflanz

    21 Apr 12 at 8:47 AM

  63. is there a way I can implement this to all spreadsheets? I’m publishing a huge number of spreadsheets. I can format each table, but too cumbersome.

    Seems like you’re on the right track, Nick. I’d suggest you add some CSS to style the .igsv-table class in your WordPress theme’s stylesheet(s) so that all your tables are styled at once. You can then tweak specific tables by targeting their individual key using CSS‘s ID selectors. For more detailed information about this, I’d encourage you to buy and read my book on the subject, AdvancED CSS. :)

    i have some conditional formatting in my google doc–basically red or green color based on values above or below zero.

    the colors are obviously getting stripped when send using this plugin.

    Anyone have any creative ideas on how to maintain formatting on the html

    Sadly, Chris, you’ll have to recreate the conditional behaviors using client-side JavaScript, as this plugin doesn’t currently support the features you’re using in Google Spreadsheets. It’d be awesome if it did, one day, though, so feel free to request a feature enhancement on this project’s issue tracker.

    when i try to create another page with [gdoc key="*****" gid="1"] the table displays but is an embedded Google Doc page with a bunch of extra noise from Google.

    Chris, I suggest that you double-check to ensure all of the Google Spreadsheet’s worksheets you want to access have been “published,” not just a range. :)

    1. I want to create different styles for spreadsheet 1 and spreadsheet 2. For example on spreadsheet 1 I want to align column 1 to the left and column 2 to the right. Is a way to modify your php file so that I have two plugins installed: IGSV-A and IGSV-B? This way I could write two sets of the igsv-table css.

    Walter, I don’t see why a second plugin is necessary. Different styles can be applied individually by targeting a table using its key, which becomes a CSS ID. For instance, if you get two tables using shortcodes like [gdoc key="foo"] and [gdoc key="bar"], then you can write CSS selectors like #igsv-foo and #igsv-bar to write styles for each table individually. Styles you want to apply to every table that this plugin produces can be applied with a class selector like .igsv-table.

    My question, is there a way to display a range of cells. I know the top rows can be stripped, but I am searching for a method to display a range.

    As I mentioned, I have a sports site. I track and list some stats for the entire season. It would be nice if I could keep only one spreadsheet with the days as rows, then display only the most recent rows, rather than create a new spreadsheet for only a small selection of data.

    For something like that, Travis, I’d suggest you create a new worksheet on which you create formulas that calculate the results you want to display from the first sheet. If I’m understanding you correctly, this would let you keep full records of your stats but would give you a new sheet with a specific view of the most recent rows.

    I hope this helps y’all, and thanks again for using my plugin. :)

    Meitar

    24 Apr 12 at 8:26 PM

  64. I just updated the plug-in, but it doesn’t show anymore the document.
    With debug enabled I get these 2 errors:

    WARNING: wp-content/plugins/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php:69 – Invalid argument supplied for foreach()

    WARNING: wp-content/plugins/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php:81 – Invalid argument supplied for foreach()

    HostFat

    26 Apr 12 at 1:13 AM

  65. HostFat, the last update changed the requirements. Please be certain you’re running the plugin using WordPress 2.7 or higher. If that doesn’t take care of the issue, make sure the Google Spreadsheet you’re embedding is still public (published) and is formatted as you’d expect. The code expects simple CSV output from Google and translates that into a multi-dimensional array, so you’re seeing those warnings because something in the process of getting the data from Google and transforming it into a multi-dimensional array didn’t work.

    Meitar

    26 Apr 12 at 2:03 PM

  66. We are having the same issue as HostFat.. We updated to WordPress 3.3.2 and page turned into nothing but errors.

    Warning: Invalid argument supplied for foreach() in /home/vg008web05/58/16/2901658/web/wp-content/plugins/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php on line 69

    Warning: Invalid argument supplied for foreach() in /home/vg008web05/58/16/2901658/web/wp-content/plugins/inline-google-spreadsheet-viewer/inline-gdocs-viewer.php on line 81

    CODE ON PAGE:

    Feel free to stop in and browse our store, located in Walford, IA. It is only 10 minutes South West of Westdale Mall on Hwy. 151.

    Store Hours:
    Monday – Friday:
    9:00AM – 5:00PM
    Saturday
    9:00AM – 1:00PM.
    Sunday Closed

    100 3rd St North
    Walford, IA 52351

    Email: store@mcbia.com
    Store Phone: (319) 845-2075

    Computers: 
    [gdoc key="0AoJcKMLY1nKXdElITGxvSC1fdU1ZZmtwNGgwcjV3cnc"]

    Laptops:
    [gdoc key="0AoJcKMLY1nKXdDJ1UTBDdnJjZ0poVkJ1UUh0VEY4dGc"]

    Printers:
    [gdoc key="00AoJcKMLY1nKXdFdzbG9aeURQQkxjeDhuRXNtMGhGYkE"]
    All Printers Have Had the Network Card Removed

    Any suggestions would be GREATLY appreciated!

    Reggie

    30 Apr 12 at 1:01 PM

  67. Hi,

    same problem here. One of a sudden I get this weird “Invalid argument supplied for foreach()” error and major parts of my blog are looking veeery strange. I’m running the latest WordPress version and did not change anything to my Google Docs documents. Any idea? Otherwise, is it possible to get hold of the older 0.2-version, which worked like a charm? Would be very grateful.

    Best regards
    Kurt

    Kurt

    30 Apr 12 at 2:00 PM

  68. Huh. I’ve just run the latest version of the plugin through some tests and it all seems perfectly fine to me. I’m not seeing any errors, so I’m at a bit of a loss to explain why you folks are.

    Firstly, though, can you try to run the plugin after de-activating any other plugins currently installed and active on your WordPress installations? While I can’t imagine there’s a conflict of some kind, it’d be good to rule out that possibility early.

    Let me know you’re still seeing errors after de-activating all your other plugins.

    Also, if any of you feel comfortable doing so, I’d be interested in doing some troubleshooting with anyone who has at least some basic PHP knowledge. If that sounds good to you, please let me know via email.

    Meanwhile, you’ll always be able to download the older 0.2 version of the Inline Google Spreadsheet Viewer plugin for WordPress at your convenience.

    Meitar

    30 Apr 12 at 5:43 PM

  69. Hi! Thanks a lot for your quick help! I will do some further testing myself later and let you know, if I could fix the error. My php knowledge is … not existing, though ;-)

    Kurt

    1 May 12 at 1:22 AM

  70. Tried de-activating all other plugins and still no luck. I uploaded the 0.2 version you supplied the link on and all the problems cleared up.. Not a clue what is causing it..

    Reggie

    1 May 12 at 7:57 AM

  71. how do you enable debug? I had this working just fine last year, but since my site is a summer camp website, I don’t look at it much until this time of year… was planning on digging into the formatting changes and options, today, but suddenly, all the pages where there should be a spreadsheet displayed are kind of blank. I look at the code and there’s a lot of table rows, but no actual content. I checked my spreadsheet and did republish it, just to be sure.

    John V

    17 May 12 at 9:43 AM

  72. Any updates available yet on the errors that some of us are getting with the latest version of the plugin?

    Thanks!
    Reggie

    Reggie

    18 May 12 at 12:55 PM

Leave a Reply