Can I create a base template for my project which all apps can draw from? Or do I have to create a base template for each app? And if I wanted them to be the same I'd just copy them?
The Django template language is Django's own template system. Until Django 1.8 it was the only built-in option available. It's a good template library even though it's fairly opinionated and sports a few idiosyncrasies.
Django Template Language (DTL) is the primary way to generate output from a Django application. You can include DTL tags inside any HTML webpage. The basic DTL tag you can include in an HTML webpage is: 1. {% Tag %}
What does {{ name }} this mean in Django Templates? {{ name }} will be the output. It will be displayed as name in HTML. The name will be replaced with values of Python variable.
{1930BBEB-7805-471A-A3BE-4858AC7CF696} is the default value and points to /sitecore/templates/System/Templates/Standard template . That's it!
Sure you can. A quick example of a base.html
<!DOCTYPE html> <html> <head> <title>My Project</title> </head> <body> {% block content %}{% endblock content %} </body> </html>
And say you have a app called myapp with a view.html page,
{% extends "base.html" %} {% block content %} <h2>Content for My App</h2> <p>Stuff etc etc.</p> {% endblock content %}
Take some time to read the docs for more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With