In the pyramid docs there is a nice tutorial on UX stuff here:
http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/humans/creatingux/step07/index.html
One thing I noticed though is in the tutorial they are setting up and passing around the 'global layout' explicitly in the code (see below). I thought this was unusual and unnecessary because I've always just used the 'load' command as shown in the docs here:
http://chameleon.repoze.org/docs/latest/
Is this just a personal preference issue or are there real advantages to setting up and using the 'global layout' in this way?
Tutorial base view class:
class Layouts(object):
@reify
def global_template(self):
renderer = get_renderer("templates/global_layout.pt")
return renderer.implementation().macros['layout']
Tutorial template file:
<div metal:use-macro="view.global_template">
<div metal:fill-slot="content">
<p>Home page content goes here.</p>
</div>
</div>
But in my template files I just use:
<div metal:use-macro="load: global_layout.pt">
<div metal:fill-slot="content">
<p>Home page content goes here.</p>
</div>
</div>