![]() |
|
#1
|
|||
|
|||
|
I've implemented templating for Boxover.
Templating would be useful for components that are used a number of time on the one page, especailly when used inside tables. I personally use complicated forms within Boxover inside big tables, so adding templating makes pages that were once half a meg(rediculous), down to a normal size(<50k). Before I posted the code, I was just wanting to know if anyone had suggestions on the best way to implement the templating syntax. To define template, I placed the templates in empty span objects placed inside the body tags near the boxover script reference. I use _boxover_templates to determine if templates have been defined, and use _boxover_templates_<template name> to access the component directly. I actually dont know how I would access the sub control from the parent control without looping and doing a id check - which seemed pointless. Replacable fields(merge fields) are indicated by the field name replaced with percentage signs eg. %field%. HTML Code:
Also, would there be compatability issues using empty SPAN's? To use the template I added two new fields, one to define the name of the template to use, and a second to define the merge fields and their values. The best idea I could come up with to confide the content - which could be anything - was to use <~ and ~>, separating fields with a semi-colon. I probably will need to change it to something else, Im not confortable with the angled brackets being in there. Maybe (~~), or two characters you wouldn't normally see together: HTML Code:
Last edited by gilgamesh : 03-30-2007 at 03:28 AM. Reason: Naming error in HTML |
![]() |
| Thread Tools | |
| Display Modes | |
|
|