Package: django-project-home-templatetags
django-project-home-templatetagsis a collection of Django templatetags to flexibly incorporate links and breadcrumbs from app pages to the homepage of a project.IfPROJECT_HOME_NAMESPACEis not defined tosettings.py, these template tags are silenced.Source code is available on GitHub atmfcovington/django-project-home-templatetags.InstallationConfigurationTemplate Tags{% load project_home %}{% project_home_url %}{% project_home_breadcrumb_bs3 %}{% project_home_breadcrumb_bs4 %}Revision HistoryInstallationPyPIpipinstalldjango-project-home-templatetagsGitHub (development branch)pipinstallgit+http://github.com/mfcovington/django-project-home-templatetags.git@developConfigurationAddproject_home_tagstoINSTALLED_APPSinsettings.py:INSTALLED_APPS=(...'project_home_tags',)Specify thePROJECT_HOME_NAMESPACEinsettings.py:PROJECT_HOME_NAMESPACE='project_name:index_view'Rather than using an internal namespace, you can also setPROJECT_HOME_NAMESPACEto a specific URL:PROJECT_HOME_NAMESPACE='djangoproject.com'By default, a link created with aproject_home_tagstemplate tag has ‘Home’ as its text. This can be overridden by defining an optional project-wide label withPROJECT_HOME_LABELinsettings.py:PROJECT_HOME_LABEL='Homepage'# Optional; Default is 'Home'Both the default and the project-wide label can be overridden by passing a string to the template tag. For example:{%project_home_breadcrumb_bs4'Custom Label'%}Template Tags{% load project_home %}Loads the project home template tags in your Django template.{% project_home_url %}A template tag to return the project’s home URL.{%loadproject_home%}<ahref="{% project_home_url %}">Home</a>Ifsettings.PROJECT_HOME_NAMESPACEis defined as'project_name:index_view', this is equivalent to:<ahref="{% url 'project_name:index_view' %}">Home</a>{% project_home_breadcrumb_bs3 %}A template tag to return the project’s home URL and label formatted as aBootstrap 3 breadcrumb.{%loadproject_home%}<olclass="breadcrumb">{%project_home_breadcrumb_bs3%}{# <--- #}<li><ahref="{% url 'app:namespace' %}">ListofObjects</a></li><liclass="active">ObjectDetail</li></ol>Ifsettings.PROJECT_HOME_NAMESPACEis defined as'project_name:index_view', this is equivalent to:<olclass="breadcrumb"><li><ahref="{% url 'project_name:index_view' %}">Home</a></li>{# <--- #}<li><ahref="{% url 'app:namespace' %}">ListofObjects</a></li><liclass="active">ObjectDetail</li></ol>{% project_home_breadcrumb_bs4 %}A template tag to return the project’s home URL and label formatted as aBootstrap 4 breadcrumb.{%loadproject_home%}<olclass="breadcrumb">{%project_home_breadcrumb_bs4%}{# <--- #}<liclass="breadcrumb-item"aria-label="breadcrumb"><ahref="{% url 'app:namespace' %}">ListofObjects</a></li><liclass=" breadcrumb-item active"aria-label="breadcrumb"aria-current="page">ObjectDetail</li></ol>Ifsettings.PROJECT_HOME_NAMESPACEis defined as'project_name:index_view', this is equivalent to:<olclass="breadcrumb"><liclass="breadcrumb-item"aria-label="breadcrumb"><ahref="{% url 'project_name:index_view' %}">Home</a></li>{# <--- #}<liclass="breadcrumb-item"aria-label="breadcrumb"><ahref="{% url 'app:namespace' %}">ListofObjects</a></li><liclass=" breadcrumb-item active"aria-label="breadcrumb"aria-current="page">ObjectDetail</li></ol>Version 0.2.1Revision History0.2.1 2018-12-09Don’t modifyhome_namespacegloballyExclude.pycfiles from distribution0.2.0 2018-12-08Allowsettings.PROJECT_HOME_NAMESPACEto be an actual URL, rather than just an internal namespace0.1.0 2018-11-20A collection of Django templatetags to flexibly incorporate links and breadcrumbs from app pages to the homepage of a project