Jump to content

User:Dantman/Code Ideas/PageLayouts

From mediawiki.org

PageLayouts is an idea for a layout extension.

  • A layout consists of:
    • A single block of markup, namely WikiText.
      • This block of markup also contains special non-typical placeholder keys. Off the top of my head, perhaps {%Some Block%}, unless we come up with something better.
    • A block of css to be applied to the page.
  • The entirety of a layout, including the css is editable by the community. Perhaps in some sort of Layout: namespace. In the edit mode or preview for a layout a user can explicitly use a button after reviewing the css to indicate they are willing to view it. This is due to the insecurity of raw css. The css for a layout can be authorized by an admin. Once authorized the css will display on any page using the layout. After the css is changed the changes must be re-authorized by an admin.
    • Perhaps we should have some sort of AuthorizedCSS extension that would abstractly allow this extension and others to have this kind of feature.
  • The layout system has a full layout editor. This allows the layout markup and css to be edited together. So there is little or no need for repetitive saving just for testing of simultaneous markup and css changes
  • When a layout is applied to a page on the wiki the content is removed from the viewing of the page and broken up into sections. The inital sectionless content is displayed following the layout's markup. The h2 (==) headers are used as key names. Placeholders like {%Some Block%} in the layout are replaced by the contents of a section marked by a == Some Block == header.