Español (spanish formal Internacional)English (United Kingdom)

PDFPrintE-mail

GTMagic DTD

GTMagic

What is it?

For a Joomla template can be integrated with GTMagic component must contain a file gtmagic.xml inside. This article explains how to define this XML file.

DTD File

<!ELEMENT gtmagic (css+, element*, image)>
<!ATTLIST css
    folder CDATA #REQUIRED
>
<!ELEMENT css (file+)>
<!ATTLIST file
    type (dinamic, static) static
>
<!ELEMENT element EMPTY>
<!ATTLIST element
    name CDATA #REQUIRED
    folder CDATA #REQUIRED
    type (dinamic, static) static
>
<!ELEMENT image EMPTY>
<!ATTLIST image
    width NMTOKEN #IMPLIED
    height NMTOKEN #IMPLIED
    ratio NMTOKEN #REQUIRED
>

Explaining the declarative file

According to the DTD file, we can see that the XML defined template for use with GTMagic, you must have a root element named gtmagic. From it, you must have a compulsory element (or several), css, an optional element, and a mandatory and unique image.

The first element GTMagic will tell what place are the CSS files and what types, static or dynamic.

With "element" can indicate additional variable elements that the end user can choose to create your set. For example, various styles for buttons.

The third element declared: image is mandatory, and defines how they will treat GTMagic header image used to generate the set of colors.

Example Usage

To get an idea of how it works, let's put the example file used in our template gtmagic.xml thefirst, in which an item is used for superior keypad and several css files, two dynamic:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install SYSTEM "http://gtmagic.joomlamagic.es/api/0.6/gtmagic.dtd">
<gtmagic>
<css folder="css">
<file>system.css</file>
<file>body.css</file>
<file>fonts.css</file>
<file type="dinamic">color.css</file>
<file type="dinamic">back.css</file>
</css>
<element name="button1" folder="buttons" type="dinamic"/>
<image width="800" ratio="5"/>
</gtmagic>

GTMagic system, reading the template chosen, load the CSS files indicated for those who are dynamic type (dinamic), made a substitution GTCss code. In the case of item button1 GTMagic system will show a form on which the user can choose one of the files offered for this item.

For the image, XML tells us how wide should be the part that will select the image, and what proportion will be divided between the width, ie in this case have a width of 800px and a height of 160px.

joomla template
TeAmoMariaJose