How to use Data Model?¶
All the classes present in the schema are accessed using the base class. (in our case the Business class)
For example, to render business name in this section:
1 | <h3>Welcome to Our <br><span>Coffee Shop</span></h3> |
Just write,
1 | <h3>Welcome to Our<br><span></span></h3> |
This will fetch the name of the business from the k-admin of the client.
Now change the description of the business,
1 | <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ..</p> |
to
1 | <p></p> |
This will get the business description from the k-admin.
So whenever you or the client updates any data on k-admin, it automatically gets updated on the website!
Note
Kitsune returns the naked string as the output, not the encoded string. For example: if "Tea & Coffee" is a product name, then the ampersand '&' is returned as '&' instead of '&'.
Let's do one more change,
To change the contact number,
1 | <h4>+1 (234) 456-789</h4> |
In the schema if you will see the contactperson
is an object of contact
class.
1 | <h4></h4> |
voilà!
Info
Kitsune also comes with inbuilt functions and operators to remove a lot of dependency of JS.