TemplatePart6






PCProfiler Template Building - Part 6



Consistency, Compatibility, and Naming Conventions
Beyond the fact that PCProfiler can allow you to design any template you can imagine, there is another key concept underlying the program's flexibility: data is not dependent on any template.
Template, I Squelch Thee
So, let's say you have a 3ED&D General Extended character sheet that is entirely filled out, but you have grown to hate that character sheet (god forbid!). You want to switch to a new one. Wouldn't it be cool, if somehow, all the data you entered into the 3ED&D General Extended template could be instantly drawn onto another template? Well, it can, provided the other template is made with compatibility in mind.

The key is for the new template to have its elements have the same name as the ones in the 3ED&D General Extended template. You see, when your data is saved, nothing with respect to the template is saved, except which template is the active one. Other than that, just the name of each element, and its value is recorded. So, if you design a new template that shares much of the same names as the 3ED&D General Extended template, when you switch between the two, your data will be preserved.

It's easy, let's rework an example from part 2 of this tutorial:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type
    content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<FORM>
Name: <INPUT type=text name=Name>
<BR>Age: <INPUT type=text name=Age>
</FORM>
</BODY>
</HTML>

Save this code to a .pcpt file in PCProfiler's Templates directory. Now fire up the program. Fill out some data on the 3ED&D General Extended character sheet, including the Name and Age fields. Then switch to your new template. What happens? The name and age are already filled out! Making your template compatible with existing templates can add extra functionality to it.

Of course, it may be that you don't want your template to share data with other templates at all. It this is the case, just use unique names for all of your inputs.



Wyszukiwarka

Podobne podstrony:
templateedit
Dworak Iwona Templariusze (5)
FREECHART template indd 1
DIY Mortis Dreadmought Plans & Templates
email template product notification
template?min
template
language template
The Modern Dispatch 076 More Starship Class Templates

więcej podobnych podstron