HTML Snippet Component

Embed custom code (e.g. CSS or HTML).

For developers only!

The DCT Help Team does not support third party code.

On this page:

Accessibility
  • Custom code must be accessible.
  • Third party content must be accessible.
  • Font size and contrast.
  • Link text should be meaningful..
  • Images require Alt text.
  • Let users control animations.
  • The 'div' or iframe of the embedded code must have a label.

> Read more about making this component accessible.

Last reviewed: December 12, 2023

Be sure to carefully test your code for major browsers (i.e. Firefox, Internet Explorer, Safari, Chrome) before uploading to the UBCMS. Poor coding may break your page unexpectedly.

When you use this component, your team commits to maintaining the security, accessibility, and stability of any linked site or code.

Overview

There are two tabs: HTML and Options. Click the wrench icon to configure these settings.

HTML filter -- This is not an 'off' switch. Read more below.

Technical Restrictions

  1. Only experienced developers should handle this component.
  2. Be sure to carefully test your code for major browsers, mobile users, and accessibility before integrating into the UBCMS.
  3. Developers are responsible for monitoring the embedded code on an ongoing basis and keeping it aligned with future code deployments and system updates.
Test carefully!

You may break your page unexpectedly and the Help Desk does not support custom code.

Consider how this custom code will display in smartphones and other small screen devices.

Consider how this custom code may impact page performance.

Configure - Main Settings

HTML Tab

Write your custom HTML, CSS or JavaScript code or paste in the 'embed code' from a third party application.

Options Tab

Description: Enter a descriptive label for the component that will be shown on your page in Author (recommended).

  • In our example below, we have inserted "Put some useful descriptive text here...". The phrase "HTML Snippet" is prepended automatically.  

HTML filter: This setting controls whether just simple HTML is allowed ('Filter HTML') or the entire block of code is active (Off). Simple HTML refers to tags like "<b>" that have no additional attributes ("<a href=...>" is NOT considered simple).  Switching the component to Filter HTML will change "<a href=some-url alt="some-text>link</a>" to just "<a>link</a>".

Choose between:

  • Filter HTML (default) - Only simple HTML is allowed. HTML Tags with attributes , CSS, and JavaScript are blocked.
  • Off - All embedded code (HTML, CSS, JavaScript) is enabled. 

Component handle - Choose to display the component's gray bar and descriptive label in Author (recommended).

Accessibility Concerns

See an Example

Examples of embedded feeds can be seen on the UB Social site.

Was This Information Helpful?

(Required)
(Required)
(so we can thank you or request more details)
(Required)
(buffalo.edu addresses only please)
(Required)