Potential Extension: Adding Attributes to the Template
Big applications can always be made bigger. This section is devoted
to showing you how to add attributes to the image template, giving
you greater control over the generated code. For the sake of
simplicity, I’ll show you how to add the IMG attributes HSPACE and
VSPACE. The procedure involves these six steps:
Add the new fields in the default template.
Create an array for its values in
setArrays().Capture the new default values.
Add text fields in the image template in
generateEntryForm().Reference and assign the new attribute values in
genJavaScript().Generate the HTML required to display the attributes in
genJavaScript().
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access