On Sat, Jul 25, 2009 at 1:58 AM, nttdocomo <[email protected]> wrote:
>
> but there isn't all the template structure like this. For example, the
> product's structure is "satchmo/apps/product/template", not "satchmo/
> apps/product/product/template". in this situation, how can we do?
Quick tutorial:
In the default Satchmo settings.py, our template loaders are:
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
These two template loaders look for the templates in two different ways.
The first one, the filesystem loader, looks for the templates in the
directories you tell it in your settings_local.py file:
TEMPLATE_DIRS = ('/path/to/your/templates',)
The second loader, the app_directories loader, looks for the templates in a
directory named "templates" in application directories.
Any time the system tries to find a template, it follows the order given
above. First it asks the filesystem loader to look in the directories it
has been given. If it finds the template there, it returns that one. Next
it asks the app_directories loader to look in the app directories for that
template. These are the "fallback" templates to use.
So, to use your "product" example, say you wanted to override the default
category page template. That lives at
"satchmo/apps/product/templates/product/category.html" It is found by the
app_directory loader if the filesystem loader doesn't find it.
Knowing that, you can tell that the proper place to put your overridden
template is at:
/path/to/your/templates/product/category.html"
Make sense? You just chop the directory tree off at the word "templates"
and build your override tree that way.
Another example, to override the wishlist index page, which usually lives
at: "satchmo/apps/satchmo_ext/wishlist/templates/index.html"
You would make a directory "wishlist/templates" and put an index.html file
in it.
--
Bruce Kroeze
http://solidsitesolutions.com
Dynamic Designs, Optimized
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Satchmo users" 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/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---