Embedding a notion page in an HTML page - html

I'm having trouble finding a way to embed a notion page in an html page. I use iframes to embed spreadsheets but Notion doesn't allow that. Is there any way to do that?
<iframe loading="lazy" src="https://dusty-agate-32f.notion.site/b52eb9b2cf3845c4a59128b7ce1c2228?v=7a8a1bb42918428d8e4b7991214cf2b7"></iframe>
Thank you!

I recently had the same issue, it looks like Notion doesn't allow iframes, it blocks the requests.
I found this tool online: www.notioniframe.com to generate an embeddable URL and the iframe HTML code to include it in any web.

In order for the iframe to work, first make sure the Notion page is public.
Secondly, there isn't an official way to do it, according to this post.
As an alternative, you can export as HTML.

Related

How would you embed RSS feeds into a static (or Hugo generated) website?

I'm looking for advice on how to embed RSS feeds into either a static HTML website or a Hugo-generated template (mentioning that in case there's any Hugo-specific solutions).
My goal is to incorporate the most recent 3 blogposts from a specific RSS feed URL and display them (appropriately styling using CSS) on this external website that I'm working on.
All solutions I'm finding online are suggesting either outdated gmodules approaches or a 3rd party tool to accomplish this. It doesn't seem like it should be that complicated - by using the RSS feed URL in an <iframe /> element, it renders, so is there any reason this is a not recommended approach?
Are there any best practices for embedding RSS feeds in an iframe?
Are there better methods for embedding RSS feeds on a website that don't involve third-party tools?
Any guidance would be appreciated. Thanks!
The point of an <iframe> is to imbed a second independent website inside the current page. So, in fact, you cannot style the contents of an iframe using the CSS of the outer page.
You can style it with javascript (see this answer) if they are in the same domain.
But if you are going to have to use javascript, it would be better to use AJAX.

How to enable other websites to embed my website's content using only content link?

I have been spending my past week on the Internet to find at least one hint about it. There are no tutorials or even SO questions available. What I am trying to find is that when some website uses some library like oEmbed to embed content of other websites on their website, they fetch embed code from its link. For example, when you post a YouTube link on Facebook or other social networks, they automatically fetch their embed code. I know how to fetch embed code but what I don't know is how to provide embed code that can be fetched by other websites by using a link of my website's content?
I want that my article should be embedded in some special way. Not like the default layout of that website. So is there any META tag or something in HTML where I can put embed code for other websites?
I don't think what you want is possible. You can use special meta-tags that specific sites (e.g.: Facebook, Twitter, Linkedin) will interpret, and that will help you customize the share a little (still using the "host site" style). But as far as I know, there's nothing you can do to provide style/code of your own.
And it makes sense from a security point of view: embedding external code from an unknown source is potentially dangerous and no site would/should allow you to do it. Even if they do allow it, they should pre-process the code and sanitize it (adapting your style/code to their style/code) to prevent possible threats.
As suggested by Alvaro Montoro, I searched on the Internet about how to become an oembed provider. Following are the links I found:
https://timnash.co.uk/becoming-oembed-provider/
http://freear.org.uk/content/5-steps-being-oembed-provider
You may want to use the CSS !important directive.
http://css-tricks.com/when-using-important-is-the-right-choice/

Iframe sandbox security

I was planning to create an app where the users can create their own blog page and others can link it in my web, like facebook. And then, I thought about using iframe with the sandbox attribute to view the page with the safe filter in the template. So, is it safe to implement it in this way??? Or is there any other way around? Please, any help will be much appreciated!
Thanks.
The safe filter in the template is your way of telling django that you can vouch for any content appearing there and that it isn't malicious. I'd therefore say it's not secure to use for user-generated content. An iframe is also unnecessary here. You might want to look at something like bleach for user-generated html content.

Splitting up a html page and loading it through header?

I am using HTML5, and would like to speed up the creation and editing of my standard HTML template by splitting it into three separate HTML files.
header.html
content.html (this will be edited and will have other names e.g. home)
footer.html
I have looked at the following resources, but I am not sure if this is possible or how to go about it.
http://www.w3schools.com/html/html_head.asp
http://www.w3schools.com/tags/tag_link.asp
In PHP I would just include the files in the right order. Is there an equivelant in just a plain HTML site?
I have googled this, but I don't think Im searching for the right term. I would appreciate any information, or resources available!
Thanks for your time!
For just a static HTML site, there is no html-only way to include files the way you are trying to. You may be able to use server-side includes depending on your server, but by that point, you might as well just use PHP.
Another option would be to make extensive use of Javascript to load the page pieces after the main part of the page is already loaded.
In all cases, though, you will have a major reduction in performance, since a server request is slow. If you need to use templates, just use a dynamic language like PHP.
You can't do it cleanly with HTML. You could use iFrames, but that's far from clean. The optimal solution would be to use PHP. It will also save you the requests from the browser.
You can do it via include files in SHTML or through some server-side processing which can combine the files into one HTML output stream when a user requests the URL. Standard HTML isn't processed on the server so you'll need to use some server-side technology such as .NET, ASP, PHP, CGI, etc.
There is no way to do this with plain HTML. You could do it using JavaScript to load the different pages into their place after loading the main page. But that seems somewhat stange and unnecessary.
The easiest way that I know how to do this is to use a Model-View-Controller (MVC) style framework of some sort. I would use CodeIgniter, which is created with PHP. It's light (2.1 is VERY fast), has incredible documentation, is super easy to understand (even if you don't know much about PHP), creates clean URIs, and will allow you to build dynamic websites (which is what you're wanting to do) with great ease. Your separate pages (called "views" in MVC terminology) will be able to load in the order you choose; in as many controller methods as you need. It's fantastic!
The following are some resources that will help explain what I'm talking about:
CodeIgniter User Guide - Model-View-Controller:
http://codeigniter.com/user_guide/overview/mvc.html
CodeIgniter User Guide - Views
http://codeigniter.com/user_guide/general/views.html
Here are some resources to help you get started with CodeIgniter:
CodeIgniter User Guide:
http://www.codeigniter.com/user_guide
CodeIgniter From Scratch Series by Nettuts+:
http://net.tutsplus.com/sessions/codeigniter-from-scratch/
Here are some resources that you may want if you need to learn more about PHP to start:
http://www.php.net
http://net.tutsplus.com/tutorials/php/the-best-way-to-learn-php/
I hope this helps, and let me know if you need any more help or a clearer explanation. Good luck!
The question is what kind result are you expect? Your question looks like you don't have experience but you feel that is something wrong with your architecture. Do you need it for any bigger webpage or for something smaller? Try to find any CMS and it will have solution to make your work more clear:) If you want to make any experiments, start from begin. You can have one layout and more content files. If your website is simple try with
<body><div>header</div><div><?php include('content'.addslashes($_GET['id']).'.php') ?></div>
<div>footer</div></body>
Don't use iframe, this is deprecated solution:)
In HTML5, you can embed (but not include) HTML documents with the object element, with the iframe element, and with the embed element.
<object data="include-me.html" type="text/html"><!-- fallback content --></object>
<iframe seamless src="include-me.html"></iframe>
<embed src="include-me.html" type="text/html"></embed>
embed
Using embed might be a bit shaky, not least because it’s intended "for an external (typically non-HTML) application or interactive content". When it doesn’t render the HTML document, try to remove the type attribute (at least it then worked in Chromium).
iframe
Using iframe might work for you in combination with the seamless attribute (beware of browser support). The HTML5 (CR) spec has an example:
An HTML inclusion is effected using this attribute as in the following example. In this case, the inclusion is of a site-wide navigation bar.
<!DOCTYPE HTML>
<title>Mirror Mirror — MovieInfo™</title>
<header>
<h1>Mirror Mirror</h1>
<p>Part of the MovieInfo™ Database</p>
<nav>
<iframe seamless src="nav.inc"></iframe>
</nav>
</header>
...
object
The HTML5 (CR) spec has an example:
In this example, an HTML page is embedded in another using the object element.
<figure>
<object data="clock.html"></object>
<figcaption>My HTML Clock</figcaption>
</figure>

A question of opinion: Are you still using iframes?

Do iframes still fit the mold of current web standards? The technology is old but I am seeing them resurface - especially with the new youtube embed code being iframes and facebook just allowing custom tabs to be iframes as well.
My question is basically: Are the acceptable?
Have a look at this SO question: Are IFrames (HTML) obsolete?
In short: They are part of the HTML 5 draft and will be sticking around. If used correctly, I think they are acceptable. :)
I agree with everyone that they should be a last resort, but there are certain things that demand the use of iframes.
For instance, there's no better way to do ajax file uploading than posting to an iframe and then reacting to the iframe's onload event to handle it.
Yes, my company still uses iFrames to embed third-party content on our site.
They still have a place but, IMHO, should be a last resort.
A lot of components such as Facebook's social widgets or Youtube's embeded player use iframes.
I also use some, when needed. Of course I don't abuse it because it's not adapted for all situations.