Javascript, Forms, and Complex HTML

 

Overview

There may be times when the editor will not be able to facilitate the edits you need to make. For instance, you may wish to embed a form onto a page that your visitors can fill out and submit. Although the editor can handle formatting text and other kinds of content, it was not designed to be able to handle forms, very complex HTML, or things like embedded Javascript snippets.

Although the editor may be lacking in the ability to incorporate these things onto a page, they can still be easily added and updated through the use of custom components.

In general, most Publishers and Writers will not need to insert such items into a page, and should avoid doing so. This will most likely be a feature that Administrators use, especially since only Administrators can setup and register custom components in the system.

If you are a Publisher or Writer and are needing to insert such items onto a page, get in touch with one of your Administrators for help.  The Campusuite support team will not help Writers or Publishers embed such items onto a page nor create a custom component for it; we can, however, take such a request from an Administrator.

 

Embedding Into a Page

Widgets (formerly components) have proved over the years to be a great way to incorporate dynamic or complex content on a page. Since custom components are easily setup and registered in the system, the process of embedding complex content, such as forms or Javascript snippets, into a page is much easier than attempting to use the page editor to do so (which would most likely fail anyways).

All that needs to be done is the following:

  1. Create a file, give it whatever name you wish, and give it a .cfm extension. This extension specifies the file to be a Coldfusion file (the lanuage the server uses for its web programming). Even if the file will not house Coldfusion code, still give it this extension.
  2. Put whatever code or content the component is to store into the file. For example, if using this method to embed a form, place the form HTML markup into the file. Be sure to save the file when done.
  3. Next, you will need to register the component within the system. This is an Administrator task, and is covered in the administration section of the documentation.
  4. Once the component is registered, it can be added to the page just like a normal component would be. When the component is processed and rendered by the server, whatever content, script, or form contained in the component should be embedded onto the page.

This will also act as a way to "share" content between pages, but should only be used to share such complex content as described earlier in the article.