Add option to automatically use `foo.shpaml` when template looks for non-existing `foo.html`

4 views
Skip to first unread message

Ram Rachum

unread,
Jan 31, 2014, 5:15:59 AM1/31/14
to shp...@googlegroups.com
Hi guys,

I created an issue on GitHub for this but there has been no discussion there, so I'm bringing it up here:

A problem with Shpaml in Django is that builtin Django apps like `django.contrib.auth` and `registration` expect to find their templates with an `.html` extension. There isn't an obvious way to make them use a Shpaml version, except heavy monkeypatching.

What I suggest: An "aggressive" option for the Shpaml template loader that, when an html template is searched, tries to use the same path name except with Shpaml at the end. (Whether the Shpaml version or the HTML version should have precedence is up for debate.)

What do you think? 


Thanks,
Ram.


James Robert

unread,
Jan 31, 2014, 5:10:55 PM1/31/14
to shp...@googlegroups.com
I'm not sure that's a good design choice.

Explicit is better than Implicit.

if you want to override an html template with a shpaml one, it's as easy as making an html file:

    {% extends "my/shpaml/template.shpaml" %}

and then putting the content in the shpaml file as your normally would (and extending the appropriate template there)




--
You received this message because you are subscribed to the Google Groups "shpaml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shpaml+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages