乐闻世界logo
搜索文章和话题

How to embed an iframe in Confluence page?

1个答案

1

The specific steps for embedding an iframe in Confluence may vary slightly depending on the version or instance (Cloud or Server/Data Center) of Confluence. However, generally, you can follow these steps to embed an iframe:

  1. Ensure HTML macros are enabled: Typically, for security reasons, Confluence disables HTML macros by default, as it allows embedding arbitrary HTML on the page, including iframe. Therefore, the first step is to check and ensure that your Confluence instance has HTML macros enabled. If you are a Confluence administrator, you can enable it in the 'Manage add-ons' section of the Confluence administration interface.

  2. Edit the Confluence page: Navigate to the page where you want to insert the iframe, then click the 'Edit' button in the top-right corner of the page.

  3. Insert the HTML macro: In edit mode, click the '+' icon or 'Insert more content' button, then select 'Other macros' from the options.

  4. Search and select the HTML macro: In the macro browser, search for and select the 'HTML' macro.

  5. Insert the iframe code: In the content area of the HTML macro, insert the HTML code for the iframe. For example:

    html
    <iframe src="https://www.example.com" width="600" height="400"></iframe>

    Ensure that you replace the value of the src attribute with the URL of the webpage you want to display in the iframe.

  6. Save the macro settings and publish the page: Click the 'Insert' button to add the HTML macro to your page, then save or publish the page.

Remember to consider security and permission issues when embedding iframe. Some websites block other sites from displaying their content in iframe by sending the X-Frame-Options HTTP header, which helps prevent clickjacking attacks. Additionally, embedding iframe from insecure sources in your Confluence page may introduce security risks.

For example, I once used Confluence to embed an iframe in a project documentation to integrate a dynamic report view. This report was generated by an internal analytics tool, providing real-time data visualization. By embedding the iframe, team members could directly view the latest project metrics on the Confluence page without leaving Confluence to access another tool's website. This significantly improved the efficiency of sharing project information.

2024年6月29日 12:07 回复

你的答案