The easiest way to master Epan Template system is to start with existing HTML Template and convert it into Epan Template. For this section we are taking one free HTML template from internet and will convert it into Epan Template.
We will have a step by step tutorial in next and a video followed by but here are the steps just to get started.
Assume you have a HTML Template in folder a folder, lets call it www, but it can be anything like template2134.
create a folder called 'layout' in your root of your template folder.
copy index.html file into it, we will extract common portion there and will replace main page with Page Epan Component.
Open that file in code editor, and do the following
Wrap your all code in body that is required under a div with class xepan-v-body, that actually acts like a virtual body for template and discards anything outside this. This helps system discard anything that is added at runtime either by scripts or any admins you have installed in your browser. usually in first xepan-sortable-component in body tag, to make it more easy to understand.
You should remove other meta tags for keywords and description.
Remove any jQuery or jQuery UI file included in this page-template, as the system will include these by itself.
Add the following lines just after your body tag to allow any analytical code to be inserted
Since your common Page-Template is ready just open all html files on root in code editor and remove all common portion from files and just leave page html content only.
Your template is now ready for Epan Website builder. Its time to make contents editable in live edit mode and allow to change images etc. It is also as easy as the above steps, in-fact easier.
To Make content editable you have to simple add few classes and/or attributes on your html tags and thats it. Here are few classes that defines what they do.
xepan-component : This css class makes anything Epan Component. That is selectable and can be moved or removed. On double click on that opens option panel.
xepan-sortable-component : This css class makes anything droppable. You can drop any other xepan-component as child of tag where this class is implemented.
xepan-editable-text : This css class makes any text editable, Yo can make complete block as editable but it is not recommended. Try to give users as much simple blocks to edit as you can. This saves them by messing things. Editable text will be used by a rich text. If you want to let user edit text but not as Rich Text, add another class to tag xepan-no-richtext.
xepan-dynamic-option-N : Sometimes, your templates are so complex that you cannot make everything xepan-component and if you do accessing them becomes problem like any text displayed on hover of a image. If you hover it displays and if you go out it is hidden again, Or sometimes you want some information to be asked from user to update html in editing mode. Here comes xepan-dynamic-options-n tag handy.
in any xepan-component you can add as many dynamic options as you want by giving each option a unique number like xepan-dynamic-option-1, xepan-dynamic-option-2 ...
Each dynamic option value is a string that defines what to ask from user in options when this component is selected and what to update when user fills the option values.
For details on dynamic-options please click here.
Let's understand template development by this short video: