Skip to content

Instantly share code, notes, and snippets.

@XertroV
Created March 25, 2014 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XertroV/9755361 to your computer and use it in GitHub Desktop.
Save XertroV/9755361 to your computer and use it in GitHub Desktop.
Geonode styling notes

Geonode styling crash course

A more general introduction can be found here: http://docs.geonode.org/en/latest/deploy/customize.html

Have a quick read through that for some background info, it's not long.

Templates structure

.
├── 401.html
├── 404.html
├── 500.html
├── about.html
├── account
│   ├── login.html
│   ├── logout.html
│   ├── password_reset.html
│   └── signup.html
├── _actions.html
├── activity
│   └── actor.html
├── announcements
│   ├── announcement_form.html
│   ├── announcement_list.html
│   └── detail.html
├── avatar
│   ├── change.html
│   └── confirm_delete.html
├── base.html
├── branding_intro.html
├── branding_logo.html
├── _comments.html
├── developer.html
├── dialogos
│   └── _comment.html
├── facebook_sdk.html
├── geonode
│   ├── app_header.html
│   ├── ext_header.html
│   ├── geo_header.html
│   └── sdk_header.html
├── help.html
├── index.html
├── lang.js
├── layers
│   ├── _actions.html
│   ├── layer_base.html
│   ├── layer_change_poc.html
│   ├── layer_detail.html
│   ├── _layer_filters.html
│   ├── layer_geoext_map.html
│   ├── layer_leaflet_map.html
│   ├── layer_list.html
│   ├── _layer_list_item.html
│   ├── layer_map.html
│   ├── layer_metadata.html
│   ├── layer_remove.html
│   ├── layer_replace.html
│   ├── layer_style_manage.html
│   ├── wps_execute_gs_aggregate.xml
│   └── wps_execute_gs_unique.xml
├── metadata_form_js.html
├── notification
│   ├── base.html
│   ├── notice_settings.html
│   ├── notices.html
│   └── single.html
├── pagination
│   └── pagination.html
├── _permissions_form.html
├── _permissions_form_js.html
├── _permissions.html
├── relationships
│   ├── confirm.html
│   ├── _list_connections.html
│   ├── _manage_connections.html
│   ├── _profile_follow.html
│   ├── relationship_list.html
│   └── success.html
├── _search_js.html
├── search_scripts.html
├── site_base.html
├── upload.html
├── user_messages
│   ├── inbox.html
│   ├── message_create.html
│   └── thread_detail.html
└── _viewby.html

Rules of thumb:

  • Templates should be edited and stored in /etc/geonode/templates/. Apache automagically gives preference to these instead of the default templates.

  • Template pages starting with _ are functional and not aesthetic. Look at them to see what structure will be produced, but unless it's really necessary, don't change the structure.

  • base.html will control the common structure of that sub-level (for example /, /layers, /maps, etc)

  • Some templates are simply for content, examples include about.html, developers.html, etc.

  • Branding is spread throughout many templates (annoyingly). branding_*.html templates are just for the index page (/)

  • /base.html will alter the entire site. Use it for things like the navbar or other global changes.

  • Many images are set through CSS and background-* properties. Remember to check there.

Static Files - CSS / JS

Static files should be put in the /etc/geonode/media folder. The folder structure will be directly overlayed the normal folder structure, so /lib/js/blah.js should be stored at /etc/geonode/media/lib/js/blah.js.

Static files are not automatically collected by apache in the same way templates are. In order to update static files the following command needs to be run: geonode collectstatic.

Static files SHOULD be referenced in the templates with a special template-url-thing. There's probably no good reason not to use this. Here's an example:

<link href="{{ STATIC_URL }}lib/css/jquery.dataTables.css" rel="stylesheet" />

Django stuff

Never use python manage.py command. Use geonode command instead. See geonode help for more info on that.

If you want more verbosity on the above commands add -v3 to the end. Or experiment with 0,1, or 2 instead.

Restarting Apache

There are only a few reasons to restart apache:

  • local_settings.py has been updated
  • apache's borked
  • geonode updated

and the like. Styling geonode doesn't require restarting apache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment