Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to get breadcrumbs from menus #1

Merged
merged 4 commits into from
Dec 14, 2016

Conversation

jbeyers
Copy link
Contributor

@jbeyers jbeyers commented Dec 14, 2016

This adds the ability to get breadcrumbs for the current object if any menuitem links to it.

The templatetag includes the preferred menu slug in case the same object is linked to from more than one menu (typically a header and footer menu). If no menu with that slug is found, it picks the first menu with a link to the object.

If no menu item is found, render nothing.

Note: This does not require the menu itself to be rendered on the page, so it can be used to construct "Shadow" menus just to enable breadcrumbs.

@coveralls
Copy link

coveralls commented Dec 14, 2016

Coverage Status

Coverage increased (+0.3%) to 94.737% when pulling 4e9803c on feature/BCX-19-breadcrumbs into ff13293 on develop.

@@ -0,0 +1,5 @@
{% load navbuilder_tags %}
{% for crumb in navbuilder_breadcrumbs %}
<a class="Crumb" href="{{ crumb.link.get_absolute_url }}" title="{{ crumb.link.title|default:crumb.title }}" target="{{ crumb.target|default:"" }}" data-slug="{{ crumb.link.slug|default:crumb.slug }}">{{ crumb.link.title|default:crumb.title }}</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indented :)

@coveralls
Copy link

coveralls commented Dec 14, 2016

Coverage Status

Coverage increased (+0.3%) to 94.737% when pulling dd9d94b on feature/BCX-19-breadcrumbs into ff13293 on develop.

@qoda
Copy link
Contributor

qoda commented Dec 14, 2016

+1

@jbeyers jbeyers merged commit 895d8ce into develop Dec 14, 2016
@jbeyers jbeyers deleted the feature/BCX-19-breadcrumbs branch December 14, 2016 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants