Confluence Embed HTML Made Easy

Author

Reads 371

Stunning aerial shot of kayakers at the confluence of two rivers, showcasing vibrant water color contrast.
Credit: pexels.com, Stunning aerial shot of kayakers at the confluence of two rivers, showcasing vibrant water color contrast.

Embedding Confluence content into your website or application is easier than you think. You can use the Confluence Embed HTML feature to add Confluence pages, blog posts, or even entire spaces to your site.

To get started, you'll need to generate an embed code from your Confluence instance. This involves copying a unique URL that will be used to display the content on your website. The embed URL is generated based on the Confluence page or space you want to embed.

The embed code can be customized to fit your website's design and layout. You can adjust the width, height, and other parameters to ensure the embedded content looks seamless with your site.

See what others are reading: How to Get Url of Image for Html

Getting Started

To get started with embedding HTML in Confluence, you need to enable the HTML Macro. This can be done by heading to Settings → Aura → Configuration and toggling the HTML (iframe) macro to enabled.

To insert the Macro, you can either click the "+" button while editing your Confluence page and choose Aura HTML (iframe) from the list of macros, or use the shortcut “/” to access it.

Credit: youtube.com, How to Embed & Render HTML in Confluence - Just Add+

The Macro allows you to customize settings to fit your needs, such as specifying the URL or code to embed, adjusting dimensions, and tweaking other parameters.

Here are the key steps to follow:

  1. Enable the Macro by heading to Settings → Aura → Configuration and toggling the HTML (iframe) macro to enabled.
  2. Insert the Macro by clicking the "+" button while editing your Confluence page and choosing Aura HTML (iframe) from the list of macros, or using the shortcut “/” to access it.
  3. Configure the Macro to fit your needs by specifying the URL or code to embed, adjusting dimensions, and tweaking other parameters.

By following these simple steps, you'll be well on your way to enhancing your Confluence pages with dynamic content and interactive elements.

Related reading: B Tag in Html

Understanding Aura

Aura is a powerful tool that lets you embed custom HTML, CSS, and JavaScript directly into your Confluence Cloud pages. It's perfect for integrating websites like Calendly bookings in a visually appealing way.

To use the Aura HTML (iframe) macro, you need to enable it first. This can be done by heading to Settings → Aura → Configuration and toggling the HTML (iframe) macro to enabled.

The macro is easy to use: you can insert it by clicking the "+" button, choosing Aura HTML (iframe) from the list of macros, or using the shortcut “/”. Once inserted, you can configure the settings to fit your needs.

Credit: youtube.com, Embed in Confluence - How to use the Embed Macro | Aura for Confluence Cloud

The Aura HTML (iframe) macro offers several benefits. It can enhance the visual appeal of your Confluence pages, increase interactivity, and simplify complex processes by embedding tools and calculators directly into your pages.

Here are some of the key features of the Aura HTML (iframe) macro:

  1. Enhance the visual appeal of your Confluence pages
  2. Increase interactivity and engage your readers
  3. Tailor your Confluence pages to your specific needs
  4. Simplify complex processes
  5. Boost collaboration and teamwork

By using the Aura HTML (iframe) macro, you can create unique layouts and make your Confluence pages stand out in a positive way.

Security Considerations

Security Considerations are crucial when using Confluence embed HTML. Sanitizing HTML in the app's configuration page and checking the Sanitize box in the macro is recommended for added safety, as it prevents JavaScript from being executed.

This option loads slightly faster, but it's worth noting that unchecking Sanitize adds risk, enabling certain classes of stored XSS attacks, such as phishing for credentials in a fake login panel. You need to trust your site users to use the macro responsibly.

The sandbox iframe does not add any CORS-related headers, but AJAX requests to services you don't control may contain CORS response headers that prevent you from using them within the sandbox iframe. This can limit the functionality of your macro.

For your interest: Using Oembed in Base Html

Credit: youtube.com, How to Add Custom HTML to Confluence Pages

If you try to include an iframe in an HTML macro, it won't work if the server for the source of the iframe sets the X-Frame-Options response header to DENY or SAMEORIGIN. This is a browser security issue that Appfire cannot control or bypass.

If you control the remote domain that is serving the source of the iframe, you can disable this setting on that server or build a proxy for that domain that strips the header. This can be a solution for many sites that don't want to show up in iframes for Intellectual Property or security reasons.

Additional reading: Inline Frame Example in Html

Customization and Troubleshooting

You can customize the HTML Macro to fit your needs by specifying the URL or code to embed, adjusting dimensions, and tweaking other parameters.

To ensure smooth performance, toggle the HTML (iframe) macro to enabled in Settings → Aura → Configuration.

If you encounter issues, review the live preview to catch any errors before saving your changes.

Recommended read: Confluence Html Macro

Customizing iFrames

Credit: youtube.com, How to create, customize and use the new Iframe Tool in order to obtain the best results.

Customizing iFrames is a crucial part of creating engaging and interactive content in Confluence. You can set a fixed height and width for your iframe to ensure that content displays properly.

To customize the iframe, you can adjust the height, width, alignment, and more. For example, you can set the height to a specific number of pixels to accommodate content that won't display properly below a certain size.

Here are some key attributes you can customize:

If the website you're trying to include isn't showing up in the iframe, try checking the website's settings or contacting the website's administrator.

Known Issues

Some websites may show up as blank when you try to include them in an iFrame. This can be frustrating, but it's not always a problem with your code.

The website administrators may have invoked the x-frame-options response header to prevent browsers from rendering it in an iFrame. This is a common security measure to prevent clickjacking.

A fresh viewpoint: Html Prevent Copy Paste

Aerial view of river confluence and structures at Devprayag, Uttarakhand.
Credit: pexels.com, Aerial view of river confluence and structures at Devprayag, Uttarakhand.

The browser you're using may also block the website from loading as a security precaution. This is usually a good thing, but it can interfere with your iFrame.

Here are some possible reasons why your iFrame might be showing a blank page:

  • The website administrators have invoked the x-frame-options response header.
  • The browser you're using has blocked the website from loading as a security precaution.

Enabling

Enabling the Confluence HTML macro requires some careful consideration. You'll need Confluence Administrator or System Administrator permissions to make this happen.

The default setting for the HTML macro is disabled, which is a good thing. This is because enabling these macros can make your Confluence site vulnerable to cross-site scripting attacks.

However, if you trust all your users not to attempt to exploit the macro, you can go ahead and enable it. We strongly recommend leaving this macro disabled if you allow self-signed up or anonymous users to create content.

To enable the HTML macro, follow these steps:

  1. Go to Administration > Manage apps.
  2. Select System from the drop down and search for the Confluence HTML Macros system app.
  3. Expand the listing and enable the html (html-xhtml) module.

Frequently Asked Questions

Can you iFrame a Confluence page?

No, you cannot iFrame a Confluence page, but you can embed a webpage inside a Confluence page or live doc using the iFrame macro. Learn how to use the iFrame macro to enrich your Confluence content.

How to embed a site with HTML?

To embed a site with HTML, use the Embed option on the Insert panel and paste your custom code into the code box. Click NEXT to preview and INSERT to add the code to your page.

Judith Lang

Senior Assigning Editor

Judith Lang is a seasoned Assigning Editor with a passion for curating engaging content for readers. With a keen eye for detail, she has successfully managed a wide range of article categories, from technology and software to education and career development. Judith's expertise lies in assigning and editing articles that cater to the needs of modern professionals, providing them with valuable insights and knowledge to stay ahead in their fields.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.