[GeoNode-users] Template extension over multiple apps
gkpetrak at gmail.com
Tue Nov 14 06:49:43 PST 2017
You don't have to name site_base.html or index.html the base templates
of your apps. You should name them in a way like: app1_base.html. So
your directory tree will look like this:
-app1_base.html (extends site_base.html which extends
-app1_index.html (if It's required)(extends site_index.html
which extends index.html)
-app2_base.html (extends site_base.html which extends base.html)
-app2_index.html (if It's required) (extends
site_index.html which extends index.html)
As GeoNode is composed of many apps see for example the directory
structure of "layers" app
site_base.html and index_base.html is the base template of your GeoNode
project in order to customize your site.
On 14/11/2017 02:48 μμ, Stefano.LUONI at ext.ec.europa.eu wrote:
> Hi everyone,
> I know that it sounds more of a Django related question, but as a non
> Django expert I'm a bit confused about the ways to extend templates.
> _The problem_
> In a development environment, suppose we have created a new app and
> suppose we call it *app1*; we can customise the page look by editing
> *site_base.html *for global parts, *index.html *or other specific
> templates, knowing that site_base will extend *base.html *from
> geonode/templates folder, and so on.
> What if we create another custom app and we call it *app2*: how can we
> define templates that could inherit from what was already defined by
> The directory tree looks like this:
> -site_base.html (extends base.html)
> -site_index.html (extends index.html)
> -new_template => how to extend site_base.html?
> The issue I'm facing is that as soon as I enable context_processors in
> my settings.py, I get an error because the Geonode base.html template
> is not found (from extends base.html in
> I tried using different configurations with loaders like app_namespace
> or apptemplates with no luck.
> Do you have any suggestions for solving this?
> geonode-users mailing list
> geonode-users at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the geonode-users