Skip to content

Template loader alters path, can't find template again #77

@jbazik

Description

@jbazik

Multisite's template loader alters the template path and passes that along to the django template loader. This works great unless some other app decides to cache that path and start over. One such app is nephila/djangocms-blog, which does this:

        selected = select_template(templates)
        return selected.template.name

(https://github.com/nephila/djangocms-blog/blob/develop/djangocms_blog/cms_plugins.py)

Select_template finds and loads the template, so the name passed back is altered by multisite. So, for instance, "home.html" is transformed into "default/home.html" which the multisite loader cannot find.

A simple workaround is to add the django loader to the template loaders. However, multisite's docs suggest that's not necessary.

I think the problem is with multisite, since it is a reasonable expectation that template.name can be reused. But I don't have a simple suggestion for how to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions