This page last changed on Oct 18, 2011 by jed.wheeler@involver.com.

Overview

Used to insert a block of HTML or JavaScript into your template. The content will render in place in the template exactly as if you had inserted it directly.

To configure an editable_html item, click the "Assets" tab in your SML editor window. This will allow you to create/edit html items.

Because the editable_html wysiwig always inserts at least basic html formatting around your text you should not insert editable_html blocks directly in into JavaScript or SML fields where the html will cause errors. Instructions for inserting the text as a variable are included below.

Use Case Scenarios

The main purposes of this tag are to

  1. Provide an easy to use WYSIWIG editor that developers can make available to clients to let them alter text without having to touch code directly.
  2. Provide allow a layer of abstraction between the main layout code and the content of a specific area.

For example, a developer might also use this tag to pull out a chunk of code or text that they want the client to be able to edit at a later time without that client having to go through the code of the tab and risk them making edits that could jeopardize the integrity of the tab.

If you want to input code directly, there is an icon on the WYSIWIG menu bar that will pop open an editor window. Using this window will allow you to bring in pre-written HTM, as well as bulky JavaScript libraries or CSS stylesheets that need to be available but which would bloat the page if you inserted them directly. By abstracting these chunks of code as assets you can insert them with a single tag, providing the functional equivalent of external CSS stylesheets and JavaScript libraries within the SML platform. This is preferable to hosting these assets externally for a number of reasons.

  1. No external hosting or content delivery system is required.
  2. Externally hosted assets do not benefit from the caching and scaling systems in place on the Involver development platform and relying on them can significantly increase load time, particularly for heavy traffic destinations.
  3. Externally hosted assets that are not hosted securely (https) will not load for users browsing facebook in secure mode.

Caching Considerations

This tag has no caching considerations.


Configuration

Note: The name should consist of only alphanumeric characters and underscore.


Attributes

name type required description
name string true This is parameter identifies which html item you would like to use in your template code.

Context Variables

A context variable will be created corresponding to the name on the editable image tag. For example:

{% editable_html name:"my_html_item" %}

This will create a context variable called html_my_html_item. In order to call the actual text string use:

{{ html_my_html_item.main_text }}

Calling it this way will allow you to run in-line filters on it to modify its outputs. This is particularly useful when you want to use it to insert text into JavaScript where html formatting would break your code. Simply add the strip_html filter to the tag to remove that formatting, like so

{{ html_my_html_item.main_text |strip_html }}

FAQ

This tag currently has no FAQ questions.


Related Topics


Document generated by Confluence on Feb 12, 2013 09:09