- Theme Engine
- Global variables
- Page templates
- Category templates
- Product templates
- EVML Reference
- Statements and Declarations
- Built-in Functions
- Built-in Objects
- EV Tags
- CSS Pre-processor
- Ajax API
We like to call it 'the magic tag'. It's the default EVML tag used to extend traditional HTML tags with both editable capabilities and multi-lingual support.
We believe that our users should be able to edit just about every piece of text on their site and the <ev:translate> tag empowers you as a designer to make design and copy choices that maintain the integrity of your theme design without compromising on user choice and functionality. If you're looking to add an editable content block specific to a CMS, Shop Category or Product page then you should checkout the <ev:editable> tag.
The default language for Evance is English, but if you'd like to build your theme in French, German and Spanish you're free to do so, you awesome linguist you. But if you're like most of us, you'll probably create your theme with no language preference:
<ev:translate> <h1>Hello</h1> <p>Welcome to Evance</p> </ev:translate>
<div> <h1>Hello</h1> <p>Welcome to Evance</p> </div>
This doesn't appear to be very useful yet. It's just wrapped our content with a <div>. Hold your horses, it's going to get a whole lot more interesting...
You may add multi-lingual support into theme files directly using the <lang:...> tag. This tag lets Evance know which languages are available to it within the code block. So if you're freakishly good at speaking different languages here's your chance to shine.
<ev:translate> <lang:en> <h1>Hello</h1> <p>Welcome to Evance</p> </lang:en> <lang:fr> <h1>Bonjour</h1> <p>Bienvenue à Evance</p> </lang:fr> <lang:de> <h1>Hallo</h1> <p>Willkommen bei Evance</p> </lang:de> </ev:translate>
If the current language is French (fr) the code block above renders as:
<div> <h1>Bonjour</h1> <p>Bienvenue à Evance</p> </div>
Evance will choose the code block relevant to the current language, or the default language (English) if it cannot find one it's looking for. You may not nest <lang:...> tags and cannot mix <lang:...> tags with non-language specific code. For example the following will not work, only the French (fr) content will be identified by Evance.
<ev:div> <h2>Hello</h2> <p>...</p> <lang:fr> <h2>Bonjour</h2> <p>...</p> </lang:fr> </ev:div>
Did you notice something else? We used <ev:div> and not <ev:translate> - magic tag remember. You can convert most block and inline tags into a translatable area. To make life easier, we still recommend using <ev:translate>.
Nested within other EVML tags
In cases where other evTags accept content <ev:translate> tags may be used. For example the following is perfectly valid.
<ev:dropdown> <ev:div class="stdpad"> <lang:en> <h2>Hello</h2> <p>...</p> </lang:en> <lang:fr> <h2>Bonjour</h2> <p>...</p> </lang:fr> </ev:div> </ev:dropdown>
NOTE: Please do not put other evTags within the <lang:...> tags.
Linking into Evance's translation database
Storing multi-language content within the theme file itself should be considered as the default text for the file. In most cases we want administrators to be able to change or translate content from within Evance CMS.
Linking your content into the Evance translation system is very simple. You just need to add a unique identifier to your
tag using the
<ev:translate ref="..."> <lang:en> <h2>Hello</h2> <p>...</p> </lang:en> <lang:fr> <h2>Bonjour</h2> <p>...</p> </lang:fr> <lang:it> <h2>Ciao</h2> <p>...</p> </lang:it> </ev:translate>
Reference naming conventions
Please follow these naming conventions when creating
ref=".." in your theme files.
Identifiers should be in uppercase in keeping with all other Evance definitions:
Shared Website Sections
These are content blocks common across most themes. For example on the shopping cart page there is content above the cart itself, which includes the page title, content and cart empty text. These are shared amongst most themes and therefore have a SHARED_ prefix. This is important so that translations, which are not theme specific are maintained if the theme is changed.
Theme Specific Content
Amongst your shared content and layout HTML within your theme files you'll probably also have content which is specific to your theme and design. These should be prefixed with the name of your theme. The name of your theme in this case should be written as one word.
How do I add my references into the database?
You do not need to add your reference into the database. The content within your theme itself will be the default content. Evance will know when your reference needs to be added to the database automatically.