Skip to content
Browse files

Adding license and readme

git-svn-id: https://django-breadcrumbs.googlecode.com/svn/trunk@5 e9f8713c-886b-11de-b5b6-bfb8bb3c0290
  • Loading branch information...
1 parent 9919ad3 commit d5e692ae88a70ab8fb9d8706b19885a82255baf7 @chronossc committed Aug 5, 2010
Showing with 90 additions and 0 deletions.
  1. +29 −0 LICENSE
  2. +61 −0 README
View
29 LICENSE
@@ -0,0 +1,29 @@
+NEW BSD LICENSE: http://www.opensource.org/licenses/bsd-license.php
+
+Copyright (c) 2009, Felipe R. Prenholato
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the Felipe R. Prenholato nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
61 README
@@ -0,0 +1,61 @@
+django-breadcrumbs is a breadcrumb system to Django framework that allow you to add custom breadcrumbs for each view and support FlatPages.
+
+django-breadcrumbs allow you to set breadcrumbs (one or more) in each view.
+django-breadcrumbs is a pluggable middleware app that set a 'breadcrumbs'
+iterable/callable object in request object that allow you add itens to
+breadcrumbs and iter on template.
+
+django-breadcrumbs accepts objects, lists or tuples added from
+request.breadcrumbs, objects need to have name and url attributes (a field,
+attribute or a property).
+
+
+1 - Flatpages+Breadcrumbs vs. only Breadcrumbs:
+
+Breadcrumbs have a simple patch to apply on django.contrib.flatpages.views,
+this path allow breadcrumbs to work with FlatPages recursively, using title
+set in admin. With 'recursively' I means that if you have /foobar/ and
+/foobar/crime/ breadcrumbs automatically create entries for both flatpages.
+
+To use Flatpages+Breadcrumbs simple copy content of django directory to your
+Django-1.1 directory and run `python setup.py install` again. You can put all
+content in your site-packages/django directory.
+
+If you want to use only breadcrumbs, copy only django/contrib/breadcrumbs to
+your django/contrib directory.
+
+2 - Setup Breadcrumbs
+
+ Breadcrumbs is easy to use, only what you need to setup is add
+ breadcrumbs.middleware.BreadcrumbsMiddleware to your MIDDLEWARE_CLASSES
+ setting on settings.py and enable it in your settings.py with options:
+
+{{{
+ BREADCRUMBS = False # Enable breadcrumbs
+ BREADCRUMBS_AUTO_HOME = False # If True, all times first link is (_("Home"),u"/")
+}}}
+
+3 - 'Registering' breadcrumbs is very, very easily. Breadcrumbs middleware
+provides a breadcrumbs() 'method' in request object. breadcrumbs() method
+accepts arguments in follow ways:
+{{{
+# one by one
+request.breadcrumbs( name, url )
+
+# various tuples/lists
+request.breadcrumbs( ( (name1, url1), (name2, url2), (name3, url3), ...,) )
+request.breadcrumbs( [ [name1, url1], [name2, url2], [name3, url3], ...] )
+
+# objects with attributes name and url in list / tuple format:
+request.breadcrumbs( ( obj1, obj2, obj3, obj4, ......) )
+request.breadcrumbs( [ obj1, obj2, obj3, obj4, ......] )
+}}}
+
+4 - To use breadcrumbs in template, only that you need is iterate over
+breadcrumbs, example:
+
+{{{
+{% for breadcrumb in request.breadcrumbs %}
+<a href="{{ breadcrumb.url }}">{{ breadcrumb.name }}</a>{% if not forloop.last %} >> {% endif %}
+{% endfor %}
+}}}

0 comments on commit d5e692a

Please sign in to comment.
Something went wrong with that request. Please try again.