Ad

Override Page.html Template From An App

- 1 answer

Is it possible to override (or overextend) the page template (pages/page.html) in Mezzanine from an app? It seems like the view mezzanine.pages.views.page will always look for (and find) the template in the Mezzanine app.

I am trying to add a tracking code (Piwik) to all the pages.

Ad

Answer

Yes.

Django uses multiple template loaders, and the one that Mezzanine will use is the "app" loader.

The only thing you need to do is to make sure that another template loader can find the "page.html" template before the "app" one.

The template loaders are called in the order defined in your settings (TEMPLATE_LOADERS).

Ad
source: stackoverflow.com
Ad