Inline frames (or iframes) can be used to embed other website content into a web page. Iframes provide a window on nsw.gov.au into another site’s content.
Inline frames are created in the media library for use across the site.
On this page
- Using Inline frames
- How to create an Inline frame
- Adding an Inline frame on a page
- How the Inline frame displays
Using Inline frames
Do
- Use iframes to embed videos or content from another source
- Use an iframe when the file is very large, such a video file, and it is best hosted on another platform.
- Use an iframe when you want the content to be viewed by users on nsw.gov.au but the original content needs to be retained by the creator or content owner. This could be for copyright reasons.
- Add a title tag to inline frames to improve accessibility.
- If you’re adding an iframe that contains video or audio content ensure you always provide an accessible text version for users with hearing difficulty, such as a transcript on your web page or closed captions for users.
- Add a heading and description above your iframe on your web page to give the iframe context.
- Always check how your iframe appears on your web page and ensure no additional advertising or unwanted information is being shown.
- Continue to monitor your iframe. If the original site owner removes the content from their site your iframe will break.
Don't
- Do not use an iframe if another component can be used in its place, as they present usability, security and SEO issues.
- For video hosted on YouTube or Vimeo use the Remote video media item.
- For audio hosted on Spotify or Omni studio use the Remote audio media item.
How to create an Inline frame
An Inline frame needs to be created before it can be added on a page.
- Go to Manage > Content > Media > Add Media.
- Select Inline frame.
- In the Title field add a unique name for your iframe. You’ll be able to search for your iframe in the media library by the title you give it.
- Enter in the Inline Frame URL. Paste the url of the content you would like displayed within your iframe.
- Enter your Agency Name.
- Enter your Editorial Group.
- Enter 600 for Height (this is the default recommended height but this can be adjusted if required).
- Click Save.
Adding an Inline frame on a page
Iframes are added on a page through the Block / WYSIWYG of your page. Learn more about the Block / WYSIWYG component.
- In your Block (on Standard pages) or Text – WYSIWYG (on Landing pages) click the Select media icon in the editor toolbar.
- Select the Inline frame media type on the left side of the Add or select media screen.
- Tick the box to add your Inline frame.
- Click the Insert selected button.
- Click the Add block button for your Block / WYSIWYG.
How the Inline frame displays
Examples of Inline frame usage on nsw.gov.au:
Need any more help?
If you have any questions, or require assistance with anything mentioned in this article, submit a request via the webform.