Created by: gwideman, Oct 11, 2010 4:46 pm
Revised by: gwideman, Nov 3, 2011 4:40 pm (7 revisions)

"Page Includes" and "Other HTML" widgets are wikispaces features which can be inserted into pages (including the "Navigation area" space.menu page). First a little background, and then some notes.

Background


Other HTML widgets can be used to:
  • Add chunks of HTML.
    • Restriction: any HTML elements must be complete, that is to say each opening tag must have a closing tag.
  • The HTML can contain Javascript, so this is a way to add scripts.
    • Scripts can be used to emit (document.write) html that is NOT closed, escaping the the restriction just mentioned

Page Includes can be used to include
  • other pages of content, obviously!
    • On the including page, the included areas can have individual edit links, and two or more can be edited by different people without conflict.
  • snippets of frequently needed html, or scripts. This is useful as HTML widgets (especially containing scripts) are tedious to copy and maintain.
    • Note that the wikitext include markup can pass arguments to the include page where they are available as variables in the HTML. (It is not clear how to use them within an Other HTML widget on that page, however.)

SealWyf writes about a number of scenarios on her Sandbox pages.

Documentation


Implications for Addons

HTML widgets can be a basis for adding functionality to wikispaces pages, and the Include Page feature provides a way to encapsulate that functionality and reuse it. However, there are issues...

Issues

The utility of the Widget and Include mechanisms is sorely compromised by some seemingly cosmetic but crippling shortcomings.

1. Gigantic size of the symbol which represents an include or widget in the WYSIWYG editor. The symbol for a widget is inexplicably huge, so that it is impractical to work with it as a basis for adding a lot of small tweaks, such as functionality for adding styling features to text.

2. Symbols have no caption in the WYSIWYG editor, so after adding a few widgets or includes to a page, it is impossible to tell which one is which without opening each one.
  • In the wikitext editor, an Include widget appears as a link to the included page, so in that context you can distinguish which is which. (In the WYSIWYG editor, this info appears in a tooltip, if you care to hover the mouse over each widget symbol.)
  • An Other HTML widget wraps a reference with a key code, so even in the wikitext editor you can't tell what it does.
The consequence of all this is that it is very difficult to use Include and Other HTML widgets except on pages where you use only one of them, such as on a page that you intend to be a component you will include elsewhere.

Wikispaces enhancements which would relieve some pressure from widgets and includes

There are some common scenarios which, if supported directly, would relieve the motivation to use widgets and includes.
  • <div>: Wikispaces' wikitext and WYSIWYG editor could support insertion of div begin and end tags (with class or id).
    • This does entail the server checking that each div has a closing tag.
  • Setting class, id, or style for other common elements
    • Style is already supported for selected text via the "Style text" dialog and associated markup. Class and id would be very helpful.
    • Tables, rows, cells
    • List elements
    • Images: There are several semantically different ways that images are used, and they need to be style-able individually.