What is a Template?
Templates are one of the big concepts of wonderful relations. In one side templates are a tree structured objects, configureable in the backend like every other page / templatebuilder.
In the other side, objects could be connected to queries. So when we see an objects with its child as a tress, for each resulting row we create a duplicate and could use our replacement strategy of data with ##_## fields. One object could be connected to one object.
Example: The Dashboard are HTML Objects (Services) which are filled by the query.
We could decide to map also Datatables to Templates. So we could have a structure like
– Template
– Template Container
– HTML Header
– Template Container
– Data Table 1
– Template Container
– Data Table 2
This strategy also works for backend / admin pages. So we could use (as Wonderful Relation it self does) create our Backend Pages, Lists etc with Wonderful Relations.
Templates:
- Template Container
- Data Tables
- HTML Object
- HTML Attributes
- HTML Objects
Attributes:
– Project
– Description
– Identifier
– Min. Userrole
Filter
HTML Object
wr_template_replace_value
HTML Objects could be linked to a query, and could be repeated based on the query data.
Usage Examples :
Using in PHP, like in a Plugin PHP Code
echo do_shortcode( "[wr_template identifier=my_template_identifier]" );
Usage in HTML, like in a WordPress Page or Post
[wr_template identifier=my_template_identifier]
Parameters
- Title
- Project
- Identifier