I am following this Developer-Workshop-Sheets to add an additional metadata field to my GeoNode. https://geonode.org/dev-workshop/#/5 (this might be lost in the future, but isn't that important to the question, so I won't copy it).

I am stuck at step 5 where I have to copy a builtin geonode template, modify it and put it in my apps template directory. Usually this is how it works to modify the stock geonode. But this time I have no luck. Putting site-packages/geonode/layers/templates/layouts/panels.html into mygeonode/mygeonode/templates/layouts/panels.html won't be enough to replace it. My changes are just ignored.

I dig into the geonode code and learned that layers/templates/layouts/panels.html is called from layers/templates/layers/layer_metadata.html where it says:

  <div id="mdeditor_form" class="col-md-12 form-controls">
    {% form layer_form using "layouts/panels.html" %}
    {# layer_form|as_bootstrap #}

My guess, as a total newby to django is, that this way of pulling one template into another isn't following the "regular" template replacement that django is usually following and is just using the path literally (but it can't be a relative path either so I am a little bit lost...). But I can't find anything about the term "using" in the documentation, mainly because that general term is used on every single page. If my guess is somewhat right, could somebody point me into a direction on how to make shure I can use the usual template replacement logic here?

And if I am totally on the wrong track, and this might be an issue of first-found-first-served (and a wrong order of custom provided templates before stock templates), where in GeoNode would I find the definition of template serving order for namespaces?

I am trying to accomplish this with GeoNode 3.0 (based on Django 2.2).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.