Ohio University
Home

Using CommonSpot to Maintain
Ohio University Web Sites


Back   Advanced Pagemasters Home   CommonSpot Tutorials Home   Next


HTML Fragment

Because of interactions between the form tags and the scripting used to achieve the Rich Text Editor on the one hand, and the code you might write on the other hand, it is not reliable to use the HTML view of a Formatted Text Block to construct forms or to place scripting content into a page.

Instead, use the "HTML" element from the "Miscellaneous" category of the Element Gallery. That will let you upload an HTML fragment file (use files that include only HTML sections that are between the <BODY> and </BODY> tags, not including those tags) from your personal computer's disk drive. You can prepare that file however you want. You can also use the HTML element to place IMAGEMAP data into a page or template.

WARNING:   do not use the "Copy element" and "Paste Element" features of CommonSpot to replicate an HTML fragment element from one page to another (it is OK within a page). If, at some later time, the original page is deleted, the HTML fragment file will also be deleted, and the page into which it was pasted will be irretrievably broken. Instead, just place a new HTML fragment element into the second page, and re-upload the file. (This bug is allegedly fixed in CommonSpot 5.0.2, but we have not yet done the experiment to confirm that.)

If you prepare your HTML fragment file on a Windows PC using Wordpad, be sure that you save the file in "Text Document" format, not in "Rich Text Format (RTF)" -- the latter will not work, and will, among other nastiness, generate content with lots of spurious, visible back-slash characters ("\"). When saving a new HTML file from Wordpad, enclose the filename in quotes (e.g., "fragment.html") so that it will not silently add ".txt" at the end of the name that you provide.

The following steps describe the techniques for working with HTML fragment elements:

  1. Click on the phantom link, "Click to insert new element."

  2. Click to expand the "Miscellaneous" category of the Element Gallery.

  3. Click on the "HTML" element.

  4. Observe at that place in your page the phantom link, "Click here to upload a document to embed as HTML".

  5. Click there.

  6. Click on the "Browse" button and choose your HTML fragment file. You may be asked whether to apply background colors or images. Your HTML will be embedded into the page. Observe the yellow work-in-progress icon; submit your change for publication when appropriate.

  7. If you are in Author or Edit mode after embedding the HTML fragment, and click on any part of it, you will be given three choices for updating that part of your page:

    • Edit Original Document: CommonSpot will download the file you previously uploaded, so that you can edit it on the computer you are currently using. Then you will upload it again to replace the prior version.

    • Edit Online: this will give you a variation on the Rich Text Editor; in general, we advise against taking this choice, at least in most of the cases where we expect people to be using the HTML element. Absolutely do not use this choice if your HTML contains any FORM components -- they will collide destructively with the behind-the-scenes implementation of the Rich Text Editor.

    • Upload Changes: you will take this choice if you have already edited the fragment file, so that you have an updated file in place, waiting to upload. You will be taken through the same browse... dialog as before. This is the preferred approach for any HTML fragment that contains FORM components (e.g., custom searches or MAILER code).


Back   Advanced Pagemasters Home   CommonSpot Tutorials Home   Next


Copyright © 2008 Ohio University. All Rights Reserved.



Dick Piccard revised this file (http://www.ohiou.edu/pagemasters/commonspot/pageadv/fragment.html) on October 7, 2008.

Please E-Mail comments or suggestions to "webteam@ohio.edu".