For reference I've asked this question on stackoverflow:
http://stackoverflow.com/q/22345527/1699750

How can I use nav-global for navigation and hide the breadcrumbs in the
django admin app. I've found ways to do this but they seem hackish and
problematic. I'm looking for a clean reliable solution.

**Naive Approach that doesn't work:**

customize admin/base_site.html

    {% extends "admin/base.html" %}
    {% load i18n %}

    {% block title %}{{ title }} | {% trans 'Django site admin' %}{%
endblock %}

    {% block branding %}
    <h1 id="site-name">{% trans 'Django administration' %}</h1>
    {% endblock %}

    {% block nav-global %}Some links will go here...{% endblock %}
    {% block breadcrumbs %}{% endblock %}

this doesn't work because the templates in django admin like
change_list.html that extend base_site.html will define content for
breadcrumbs which will override whatever I have set in base_site.html.

**solution 1: CSS**

Add the following css to admin using the extrastyle block. This works, but
the breadcrumbs still get generated and appear in the HTML source. This
feels hacky.

    .breadcrumbs {
        display: none;
    }

**Solution 2: override base.html**

Override base.html and remove the breadcrumbs block. Children will try to
define it but it never exists so it never gets rendered. This also seems
like a hack. It's also not a good idea to override base.html as each Django
release can make many changes to base.html and the admin app could break
between releases.

I just wanted to make sure there isn't some simpler way that I'm missing.
Thanks in advance.

Cheers,
Marwan AlSabbagh

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPdSytJsGpcREnrfqK_B0hx_cW8byJaTc6wtL7OfgiGpvrVxog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to