I have a Google Docs collection that I would like to embed into an iframe:
https://docs.google.com/open?id=0B6yYgWS-CUJ2ZTUxZGI4MGUtMWM0Yy00YzY0LWIxOTMtMDFlN2RjNDAxNGM2
The problem here is that Google has set the X-Frame-Options header and so it seems they only allow this collection to be embedded into a Google site:
X-Frame-Options: SAMEORIGIN
Now I realize Google's reasons for not allowing their content in iframes some of the time, but this is one case where I feel like it would be nice to have the ability to do this.
With documents Google also allows two methods of "sharing"
You can click on the "Share" button and set visibility, which will give you a link to a document
Or you can click on "Publish to Web" and it will give you a link or an iframe option.
The iframe url is similar to the link URL except that it has the "&embedded=true" query variable at the end. The same thing is true for Google Maps except the parameter is "&output=embed"
Who while I believe there is nothing I can do with headers or Javascript on my site to allow the content of an iframe for a Google Docs collection to load, I was hoping someone might know of a way to generate embed code for a Google Docs collection which would allow it to be loaded in an iFrame.
Update: It looks like Google has allowed embedding Google Docs/Drive items via iFrame. Here are the current headers for that page (note that this URL is after the redirect):
Try these:-
single – setting to true displays just one sheet in the spreadsheet. The default sheet it will display is the first one created in the spreadsheet. This can be changed using ‘gid’ below.
gid – this needs to be a numeric identifier of the sheet you want to display. The first sheet created is 0, but others will have longer identifiers. To find the ‘gid’ for the sheet you want to display, go to the spreadsheet in Google Apps itself, and click on to your desired sheet. The URL in your browser should change to something like this: https://docs.google.com/a/mycompany.com/spreadsheets/d /15B___SOYjsRmU9tiwZly318HZnFHOHeayS6UTHx7Pu2I/edit#gid=419657423
The bit at the end of the URL shows you the ‘gid’ for the sheet, and that is the number you need to bring into the shortcode in your website.
range – set this to the cell range you want to display within the sheet (or leave it out to display the whole sheet). In our example, we set this to f2:g6. Note if you’re being pedantic then you should really change the ‘:’ to ‘%3A’ since colons should be encoded in URLs – but most browsers should understand the colon, so don’t worry. If you like to be correct, you’d use range=f2%3Ag6 instead.
headers=false - Row numbers and column letters are not displayed.
widget – setting this to false removes the sheet selector bar when it’s embedded.
chrome – setting this to false removes the title bar showing the spreadsheet name, above the sheet.
So putting all together:-
<iframe> src="https://docs.google.com/spreadsheets/d/[Googlekey]/pubhtml?gid=28&range=a1:s45&single=true&widget=true&headers=false" </iframe>
Allan
Related
I would like to embed a Google Slides presentation with an iframe. Anyone with the link can view it but I do not want to publish it to the web.
The "Publish to the web" option is specifically meant to embed the presentation within iframes so anyone with the link can view it, and it also gives you the iframe code, but I'm guessing that by "do not want to publish it to the web" you mean that you don't want the file to be indexed in Google searches.
According to this support thread to avoid getting indexed you can click the "Share" button and set the sharing option to "Anyone with the link":
Then to embed it within an iframe get the sharing link and replace /edit with /embed to it at the end. Example: https://docs.google.com/presentation/d/<Slide_ID>/embed.
The result looks the same as getting the "published" link, but it's not indexed by Google Search. Of course, keep in mind that it may still be found if the website where you embedded it is indexed.
System can automatically find that particular document and highlight it, if this document is available on first page of pager.
http://ZZZZZZZZZZ:10080/share/page/site/my-site/documentlibrary?file=IFTF_Ten-Year%20Forecast%20-%20Perspectives%202008_04-2008.pdf#filter=path|a.%20Secondary%20Research/Themen/01.%20Macro%20Environment/Future%20Trends.
but if i search some particular document which may be on other page, it is not position correctly.
i need way to do that? this is my link to click
<a target='_blank' title='${msg("label.open_folder")}' id="yui-gen112" href="/share/page/site/${item.site.shortName!''}/documentlibrary?file=${item.encodedName}#filter=path|${item.path!''}">${item.path!''}</a>
You're right that the file param only highlights the document if it appears on the current page - it's a client side highlight and entirely isolated from pagination controls.
It sounds like you're trying to deep link to whichever document library page a given document appears on and highlight that document. I don't think that's possible: the page the document is on may change when content gets added and deleted and may vary from user to user if they modify their individual sort order.
This may not be the answer you're looking for, but if you want to link to a specific document, then your best bet is probably to link to the Document Details page, which has the url format:
/share/page/site/${item.site.shortName}/document-details?nodeRef=${item.nodeRef}
sory guys, click the first link you will see the image i been mark by red, after you click the second link, you will see the arrow.
1) http://s261.beta.photobucket.com/user/minaekoz/media/satu.png.html
2) http://s261.beta.photobucket.com/user/minaekoz/media/satua.png.html
Question :
That is social bookmarking site i use to promote my blog but i want to remove the plugin after somebody click that link in the first image.
how can i remove that plugin in the second image after user click the link at the first image?
*sory if my english so bad
I'm not sure how your page is embedded, I guess it's done using frames or an iframe? This would be important to know, but you'll most likely be able to use some javascript code like this (called in some element's onload event (e.g. <body>):
if (window.top != window.self)
window.top.location.replace(window.self.location.href);
I think you can add it through using a custom BlogSpot template or maybe with some of the widgets as well.
Probably you can't. That social bookmarking site will probably open your website in an IFRAME, and therefore, clicks in your page cause IFRAME navigation, and not browser navigation.
Since your site, and the IFRAME site are different, the javascript in your site cannot access the DOM (Document Object Model) in the other site because SOP (Same Origin Policy).
You can disallow that your website run in IFRAMEs by using the X-Frame-Options http header though, but I would leave it like that.
Cheers.
What I Wanted
I was going to use urls like /item/xxx (viewing an item) and /item/xxx/photo (viewing the full screen photo of an item) because I thought that looked better and was more RESTful.
Problems
I realized that I wouldn't be able to track total item views because the urls would cross over each other (i.e. you can see the total hits you had to all urls starting with /item/ but that would include the photo URLs).
I wouldn't be able to track the total photo views because the url would have the id before the photo part (i.e. I can't look at all urls starting with /item/xxx/photo
Question
Am I wrong? Can i still find these numbers (I'm using Google Analytics)? Or am I better off changing the URLs to /item/view/xxx and /item/photo/xxx? This is for an iPhone app so the URLs are really arbitrary (I can set them to whatever I want and no one will see them except in the analytics).
If you want to get metrics for just URLs with the /item/xxx structure while excluding /item/xxx/photo ones, instead of just typing text into the filter box, you can use the advanced filter option for 'Matching RegExp'. (Click on the text 'advanced' next to the text entry field).
And use a regular expression to exclude the /item/xxx/photo while also including /item/xxx:
Exclude Page Matching RegExp: item/(.)*/photo$
And Include Page Containing: item/
I've looked this up and have not found consistent answers. I want to embed a google doc in my page (when you publish your google doc it gives you an iframe). Will search engines like google be able to read the contents of the document (just text, but may have important keywords)? Or will it act as if the page was empty?
If it cannot index the text then is there any way to have the embed in some sort of server side include so that it appears to be hard-coded into the html to spiders?
No, they will not read it and assosiate the content to your site. They will eventually crawl it sometime but it will not be associated as "your" content.
Only way to do it, is to write server side code that scrapes the content and outputs it inside your page.
Right now, the page looks empty to the search engines.
I am not so sure that they can't since you can start seeing iframe content being rendered in the site previews under Google Search i.e. any facebook page tab application can be seen now and they all work through iframes