'gNeandr' via bottlepy
2017-02-10 12:03:55 UTC
Need some advice to use rebase and/or include.
For building a flexible concept with a variable menu system I need to
insert a 'menuY.tpl' template into different 'mainX.tpl' pages.
Sounds easy but not only the pages need
thisTemplate = template('mainX', keys)
but also the menus need changing menukeys
thisMenu = template('menuY', menukeys)
How to define the different instructions?
python
@app.route('/doit')
def week():
...some code here to load keys etc ...
thisTemplate = template('mainX', keys)
return thisTemplate
mainX.tpl with
<body>
% insert ('menuY', rv)
<section class="container">
<p>{{param1}}</p>
some html code for the main page
</section>
</body>
menuY.tpl with just html code for the menu code like this
<div id="hambgMenu">
<a href="/">Home - {{titleY}}</a>
<a href="/week">{{titleZ}}</a>
</div>
This will not work, at the mainX.tpl line with % insert python says:
NameError: name 'insert' is not defined
Also how are the **variables (titleY,titleZ) passed to that 'menuY'? There
is no reference for 'rv' with the coding above.
--
For building a flexible concept with a variable menu system I need to
insert a 'menuY.tpl' template into different 'mainX.tpl' pages.
Sounds easy but not only the pages need
thisTemplate = template('mainX', keys)
but also the menus need changing menukeys
thisMenu = template('menuY', menukeys)
How to define the different instructions?
python
@app.route('/doit')
def week():
...some code here to load keys etc ...
thisTemplate = template('mainX', keys)
return thisTemplate
mainX.tpl with
<body>
% insert ('menuY', rv)
<section class="container">
<p>{{param1}}</p>
some html code for the main page
</section>
</body>
menuY.tpl with just html code for the menu code like this
<div id="hambgMenu">
<a href="/">Home - {{titleY}}</a>
<a href="/week">{{titleZ}}</a>
</div>
This will not work, at the mainX.tpl line with % insert python says:
NameError: name 'insert' is not defined
Also how are the **variables (titleY,titleZ) passed to that 'menuY'? There
is no reference for 'rv' with the coding above.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.