i went the "all paths as asset specs" route for mako, but then found
it easier to provide support for plugins to override templates by
specifying an additional asset spec for the mako_directories config
setting. it's a bit less flexible because you can only override
templates by ones with the same relative path, but i think it's also
more transparent than override_asset.

On Mon, Mar 19, 2012 at 8:17 PM, Chris McDonough <[email protected]> wrote:
> On Mon, 2012-03-19 at 12:13 -0700, Mike Orr wrote:
>> On Mon, Mar 19, 2012 at 11:49 AM, Chris McDonough <[email protected]> wrote:
>> > The asset override stuff also allows you to switch templates for a given
>> > view, if that's all you need.  It's documented at
>> > http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/assets.html#overriding-assets
>>
>> ... if you're using an asset spec for the template. If you're using a
>> filename and depending on the Mako search path, would this still
>> apply?
>>
>> PS. When I read in the docs that you could make a Mako application
>> entirely with asset specs, you wouldn't need the Mako search path, but
>> when I tried it I couldn't get it to work. I may have had the wrong
>> asset syntax, or maybe it was just because my templates have an
>> inherited site template.
>
> Dunno but Ben added support for asset specs to the Mako stuff, he may
> know.
>
>> In any case, I don't think asset specs for Mako will become popular
>> unless there's a way to shorten the syntax.
>> 'renderer="myapp:templates/abc.mako"' takes up so much space it forces
>> you to split the @view_config to multiple lines, which is not the case
>> in its TurboGears and CherryPy predecessors. If I just specify
>> "/abc.mako", it seems to not consider it an asset spec.
>
> If I had it to do all over again, I would not provide support for Mako
> search paths at all and do it how Chameleon bindings do it (everything
> is an asset spec there, and relative filenames are asset specs relative
> to the package they're defined in).  C'est la vie.
>
> - C
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/pylons-discuss?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to