Comments (3)
The idea is to work with themes, but with fallback to defaut templates in /templates folder. I will take a look on this , if needed I will change the way templates are being loaded.
Any help or suggestion is appreciated.
Tks
from quokka.
I changed the way quokka_themes loads the templates, now the behavior is:
- Always try to find the template inside themes/theme_name/template_path
if not found, then: - Try to load the template from app quokka/templates/template_path
if not found then: - Try to load the template from blueprint/template_folder/template_path (default flask behavior)
if not found then: - raise TemplateNotFound exception.
Also I changed the way render_template works. Now you can pass only one template_path:
return render_template("template_path/template.html")
Or you can pass a list of templates to try:
return render_template(["path1.html", "path2.html"])
Also in default content views it will add automatically the templates "content/**object_class_name_**detail.html" and "content/**object_class_name_**list.html" as the high priority templates.
So in example for quokka-commerce: ['content/commerce_product_detail.html', ....]
The object_class_name is modulename_modelname
In that way if the module needs to use a customized template it can do by the above method or creating a custom view for the module and registering a specific url.
OBS: All the text above need to go to the wiki.
from quokka.
Template loading order to include in wiki
1 content/
2 contentlongslug.html
3
4 appname/channellongslug__modelname_suffix.html
5 *_recursiveuntilroot_modelname_suffix.html
6 appname/channellongslug_suffix.html
7 *_recursiveuntilroot_suffix.html
8 appname/modelname_suffix.html
9 appname/suffix.html
10
11 channellongslug_modelname_suffix.html
12 *_recursiveuntilroot_modelname_suffix.html
13 channellongslug_suffix.html
14 *_recursiveuntilroot_suffix.html
15
16 modelname_suffix.html
Try the above in /themes/ and also in /templates/
at last try to load.
18 suffix.html
from quokka.
Related Issues (20)
- Quokka ScreenShots HOT 6
- How to setup by Using MongoDB docker
- Quokka installation more instructions. HOT 5
- Info about static files HOT 2
- Logout Action in Admin HOT 3
- Guidance and advice, if possible, please... HOT 1
- replace markdown (mistune) with Commonmark
- Quick Start: 'make adduser' throwing exception HOT 3
- jinja2.exceptions.UndefinedError: 'theme' is undefined HOT 1
- Neither pyproject.toml nor flit.ini found, and no other config file path specified HOT 1
- What license is this? HOT 4
- demo site is down? HOT 3
- removing files/modules unused from Quokka project HOT 1
- Cross Site Scripting Vulnerability in Latest Release HOT 1
- XML External Entity (XXE) Vulnerability in Latest Release HOT 1
- TODO: list from quokka/quokka/core/content/models.py HOT 2
- Change version of `dynaconf` in `requirements.txt`
- Small typo in quokka/core/content/views.py
- make adduser fail - AttributeError: module 'mistune' has no attribute 'Renderer' HOT 1
- closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quokka.