Plugin Author
Meitar
(@meitar)
Yes. As the description in the readme states:
You can use the gid attribute to fetch data from 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"]
For a new Google Sheet, the gid value is usually a long number at the end of the URL when viewing the sheet, like, https://docs.google.com/spreadsheet/d/ABCDEFG/edit#gid=123456 or similar.
Hi Meitar.
First of all, wonderfull plugin – great work! Thanks 🙂
I too have read this readme file on how to display a certain sheet, cause I have 4 different sheets in my spreadsheet, and want to display them in different locations on my page.
I have this one (test sheet):
[gdoc key=”https://docs.google.com/spreadsheets/d/19xBIy3YGenl1CGRvETsbQQtlDoNsF1Y3HqDspZpR0vU/edit#gid=134871641″ chart=”Bars” chart_aggregation_target=”auto”]
As I see it, it should show the sheet with the “gid=134871641”, but actually it shows the same as this one:
[gdoc key=”https://docs.google.com/spreadsheets/d/1dw_2FdFoljidAcRJHcZhO-VvKL-rzRgbuDxuxEiStIw/pubhtml” chart=”Bars” chart_aggregation_target=”auto”]
Both addreses show the same sheet on my page. Also tried removing the “edit#” in front of gid= and so on…
The sheet(gid) I want the plugin to point to, has this address:
https://docs.google.com/spreadsheets/d/19xBIy3YGenl1CGRvETsbQQtlDoNsF1Y3HqDspZpR0vU/pubhtml?gid=134871641&single=true
But the one it points to has this address:
https://docs.google.com/spreadsheets/d/19xBIy3YGenl1CGRvETsbQQtlDoNsF1Y3HqDspZpR0vU/pubhtml?gid=0&single=true
What am I missing?
Best regards
Michael
Plugin Author
Meitar
(@meitar)
Hi Michael,
What you’re missing is that the gid value needs to be its own attribute in the shortcode. This is due to historical reasons and may be removed as a requirement in a future version. But for now, if you want to display any sheet other than the first one, you have to put the gid value into its own attribute.
So, like this:
[gdoc key="https://docs.google.com/spreadsheets/d/19xBIy3YGenl1CGRvETsbQQtlDoNsF1Y3HqDspZpR0vU/edit" gid="134871641"]
Hope this helps.
Thank you so much! It saved me a lot of trouble!
Thank you thank you 😊😊😊