prymitive / bootstrap-breadcrumbs

Django template tags for easy breadcrumbs using twitter bootstrap css classes or custom template
django-bootstrap-breadcrumbs.readthedocs.org
MIT License
93 stars 48 forks source link

bootstrap_for template tag does not support named view with namespace #12

Closed luzfcb closed 10 years ago

luzfcb commented 10 years ago

bootstrap_for template tag does not support named view with namespace

myapp urls.py

urlpatterns = patterns('',
    url(r'^create/$', 'myadd.view.myview_create',  name='make_magic' ),
)

project urls.py

urlpatterns = patterns('',
    url(r'^$', include("myapp.urls", namespace="myapp")),
)

on template:

{% load i18n %}
{% load django_bootstrap_breadcrumbs %}

{% block breadcrumb_head %}
    {% clear_breadcrumbs %}
    {% breadcrumb_for "myapp:make_magic" %}
        {% trans "Make Magic" %}
    {% endbreadcrumb_for %}
{% endblock breadcrumb_head %}

The result is an incorrect url. The generated code is:

<a href="myapp:make_magic">
        Make Magic
    </a>

the django url template tag can properly resolve this url. I suppose that perhaps part of the code solves the url, could be replaced by a direct call to the django url template tag

prymitive commented 10 years ago

Try without quotes (``{% breadcrumb_for myapp:make_magic %}), parser doesn't expect them there

prymitive commented 10 years ago

is this on django 1.6.1 or some older version?

luzfcb commented 10 years ago

django 1.6.1

prymitive commented 10 years ago

I've made demo app but I can't reproduce it, can you try it? Check if it matches your code and templates. Quotes shouldn't matter.

After that curl gives me:

$ curl http://localhost:8000/myapp/about

= BEGIN =
<ul class="breadcrumb">

    <li>

            <a href="/myapp/about">
    Make Magic
</a>

            <span class="divider">/</span>

    </li>

    <li>

            <a href="/myapp/about">
    Make Magic 2
</a>

            <span class="divider">/</span>

    </li>

    <li>

            Home

    </li>

 </ul>

= END =
prymitive commented 10 years ago

Is this issue still present?

prymitive commented 10 years ago

No response so I'm closing this one, if you still have any issues just let me know, thanks