XF 2.2 Embedded Spreadsheet

Joan1211

Member
Hello,
How can I embed a spreadsheet?
I have tried many tutorials, using BBCode and Import Media, but they don't seem to work. I might not be executing the steps correctly.


Here is the code I receive when I click on "publish on the web":

Embaded code:
Code:
<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vS0dpVO92b1_4CUjFNd-fyOGPkXcmk2C3B5SPs-foxlwDoKNwfwW-q1qxIGy2xzO5rHf7kMyUu8NZfa/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false"></iframe>

Link:
Code:
https://docs.google.com/spreadsheets/d/e/2PACX-1vS0dpVO92b1_4CUjFNd-fyOGPkXcmk2C3B5SPs-foxlwDoKNwfwW-q1qxIGy2xzO5rHf7kMyUu8NZfa/pubhtml?gid=0&single=true

Thank you.
 
Xenforo support informed me that i need to create a custom BBcode.

I have tried this option before, but this did not work. The tutorial i found are propably too old.

Anyone can help with this?

Thanks.
 
It may be better to use variable parameter, so you can embed different spreadsheets? Of course, if you want to do that.

In HTML replacement part put this:

Code:
<iframe src="https://docs.google.com/spreadsheets/d/e/{text}>/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false"></iframe>

And within new BBcode you put variable part, in your case it's this:

Code:
2PACX-1vS0dpVO92b1_4CUjFNd-fyOGPkXcmk2C3B5SPs-foxlwDoKNwfwW-q1qxIGy2xzO5rHf7kMyUu8NZfa

In above's example it would be:

Code:
<spr1>2PACX-1vS0dpVO92b1_4CUjFNd-fyOGPkXcmk2C3B5SPs-foxlwDoKNwfwW-q1qxIGy2xzO5rHf7kMyUu8NZfa</spr1>

It would work for all different spreadsheets.
 
Thank you.
One small correction:
Code:
<iframe src="https://docs.google.com/spreadsheets/d/e/{text}>/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false"></iframe>

for it to work there is no
Code:
>
before
Code:
/pubhtml?

This code is great for variable spreadsheet. However this mean that all the spreadsheet will have the same displayed size.I configured mine to have 3000px, therefore all the spreadsheet will have 3000 px.

i tried to remove the size from the HTML replacement and to insert it here:
Code:
[spr1 width="100%" height="3300px"]spreadsheetID[/spr1]

But this did not work.
 
Yeah, I somehow made error in copying. Who knows how that happened. :eek:

And, from original code, I don't see info on width and height, so I'm not sure where and how you're inserting it. You should find it first in original Google insert code, to know where they expect it to see that information.
 
Urgh, I'm not succeeding with this at all.

The Google embed code has changed slightly, and I'm not sure if that's part of the problem, but here's what I've got:

Code:
<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vTAwt7Gu5IL0UCZFJNurbpUDPJzZeryzS6cUH5ihNiRB9xU69iqnIjnUa95RjiX5C8LbZ-peBeuNxvG/pubhtml?widget=true&amp;headers=false"></iframe>

(Note that the changes are mostly at the end of the code string.)

I enter that code into my custom BB Code module:

1711233735206.webp

I've saved it, then entered the BB code tag in my post as in @Paul B's example above:

1711233818331.webp

But the only thing that shows up in the post is the word "Testing".

I've also doublechecked that the sheet is published to the web (it is; here's the link if you care to take a look), so I have no idea why nothing is showing up.

Any pointers for me?

Many thanks!
 
Might be overkill for what you need, but this addon supports Google Sheets.


The latest version seems to have the updated embed code for Google Sheets.

It's as easy as getting the link via the Share button...

1711418227833.webp

...and pasting that link into the XF post. Just be sure that you're sharing with viewing privileges, not editing privileges.
 
Might be overkill for what you need, but this addon supports Google Sheets.

I should have mentioned, that's where my frustration started. I have that add-on and love it. I first added it to support our members' SoundCloud embeds, but I'm not getting the Google sheets to display at all.


Just be sure that you're sharing with viewing privileges, not editing privileges.

That may be the problem. Editing is definitely enabled.

I think I may not be able to embed the sheet until the community has finished the collaborative database we're trying to build together. It's too big a project for even a committed handful of people, but a forum with 140,000 active members feels just about the right size. 🤣 I'd hoped to keep the while things I'm the forum to encourage participation, but if I can only embed it as non-editable, then I'll just change the process.

Thanks for pointing me in this direction, though! I'll tweak it and try again!
 
I should have mentioned, that's where my frustration started. I have that add-on and love it. I first added it to support our members' SoundCloud embeds, but I'm not getting the Google sheets to display at all.
MIne weren't displaying just a week or so ago, but I found I had to upgrade to the most recent version for it to work. As you mentioned above, there may have been a recent change to the embed code that caused mine to malfunction as well.

You could create a new sheet for testing and see if it works, without having to expose the project you're working on. I don't think read-only vs. edit should affect that--I've never tried it, to be honest, but I can think of a few uses for our staff where we might want to edit a sheet (such as, for tracking giveaways on one of the forums).
 
Back
Top Bottom