Comments (6)
@robnewman, in time I wrote this app, I have not used flatpages in urls like you showed.
Reading django 1.4.1 code right now, this include just to all django.ontrib.flatpges.views.flatpage, and, in that, we have nothing that I can connect and do breadcrumb 'magic'.
I check it fast, but as I see now, we have two options:
1 - Copy flatpage view to breadcrumbs, and change it to show breadcrumb.
2 - Write some decorator to apply to url, but I don't know if decoratores in urls.py work for includes.
I'll have time only by Sunday now, so if u want to fix with one of these options, I'll love to merge a pull request :).
from django-breadcrumbs.
Thanks for the rapid response. If I get time today or over the weekend I will fork and try to fix it.
from django-breadcrumbs.
Deal. With that fixed I issue release 1.1.2
from django-breadcrumbs.
I am actually starting to wonder if this is a non-issue. You can add a pseudo catchall by adding:
urlpatterns += patterns('django.contrib.flatpages.views',
(r'^flatpagedirectory/$', 'flatpage'),
)
This will direct any request below 'flatpagedirectory/' to the flatpages app and your breadcrumbs resolve correctly.
You just have to ensure that is is placed below all your other url patterns so that it doesn't override your app specific views. Any request that doesn't match an app or a flatpage will just return a 404 anyway.
What do you think? If you agree, you could probably close this issue as a won't fix.
from django-breadcrumbs.
No, we really have a issue.
The (r'^flatpagedirectory/$', 'flatpage')
returns a flatpage in url /flatpagedirectory/
. If it exists in DB we go to stock flatpage view, and revelant code is at http://goo.gl/cmuCO ... if you see my code at http://goo.gl/ubo8j they are pretty similar, except that with flatpage object I call breadcrumbs_for_flatpages
to build breadcrumbs.
So if we use stock flatpage view, we can't call breadcrumbs_for_flatpages
and don't have breadcrumbs loaded (this apply to all examples in Django doc: http://goo.gl/iCvf3).
Now looking better at issue, to fix this we should:
1 - create a breadcrumbs.views.flatpage
, that, is same as django.contrib.flatpages.views.flatpage
, with addition of the call to breadcrumbs_for_flatpages
like in current breadcrumbs.middleware.FlatpageFallbackMiddleware
2 - Make breadcrumbs.middleware.FlatpageFallbackMiddleware
use that view, like stock middleware
3 - Change breadcrumbs docs to instruct to use breadcrumbs.views.flatpage
instead django.contrib.flatpages.views.flatpage
in url conf.
from django-breadcrumbs.
Sounds like you have a good grasp of how to fix it (at least better than me right now).
from django-breadcrumbs.
Related Issues (8)
- Add a small note on the context_processor HOT 1
- Why is Breadcrumbs a Singleton? HOT 5
- This project needs a maintainer HOT 1
- Unit tests in the django flatpage's app fail when breadcrumbs FlatpageFallbackMiddleware is enabled. HOT 3
- Django 1.10 support? HOT 5
- Update pypi package HOT 5
- Write unit tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-breadcrumbs.