Jmbo foundry behavior/templates app.
Contents
Install or add
jmbo-foundry
to your Python path.Install
django-preferences
as described here.Add
foundry
to yourINSTALLED_APPS
setting.Add
foundry
URL include to your project'surls.py
file:(r'^', include('foundry.urls')),
jmbo-foundry
includes a number of template sets allowing you to deliver lightweight(zero
), mobile(basic
) or desktop/touch(full
) specific output. Specifying which template set to use is simply a matter of specifying aTEMPLATE_TYPE
setting, and addingfoundry.loaders.TypeLoader
to theTEMPLATE_LOADERS
setting. For example to use thebasic
template set update your settings as follows:TEMPLATE_TYPE = "basic" TEMPLATE_LOADERS = ( 'foundry.loaders.TypeLoader', ...other template loader classes... )
This causes templates to be loaded from a path prefixed with whatever value was specified as the
TEMPLATE_TYPE
setting. For example in this case a template specified asfoundry/home.html
would actually be loaded frombasic/foundry/home.html
.Note
You have to add
TypeLoader
as the first loader for it to resolve templates correctly.jmbo-foundry
includes static media resources which you need to configure as described in Django`s managing static files documentation.Add
foundry.middleware.AgeGateway
to yourMIDDLEWARES
setting afterAuthenticationMiddleware
.Optionally add
foundry.middleware.VerboseRequestMeta
to yourMIDDLEWARES
setting as the last entry. It adds more information to the request for easier debugging.
Used in conjunction with {% menu %} and {% navbar %} to provide an admin configurable navbar and menu.
A short descriptive title for link.
View name to which this link will redirect. This takes precedence over category and url fields.
Category to which this link will redirect. This takes precedence over url field.
URL to which this menu link will redirect. Only used if view_name is not specified.
Returns URL to which link should redirect based on a reversed view name as specified in view_name field or category view for category specified in category field or otherwise an explicitly provided URL as specified in url field.
Determines whether or not the link can be consider active based on the request path. True
if the request path can be resolved to the same view name as is contained in view_name field. Otherwise True
if request path starts with URL as resolved for category contained in category field. Otherwise True
if request path starts with URL as contained in url field.
Used to determine position/order of elements in {% menu %} and {% navbar %} inclusion tags.
Specifies position/order of link in {% menu %} and {% navbar %} inclusion tags.
Provides foundry inclusion tags like {% menu %} and {% navbar %}. Load these tags by including {% load foundry_inclusion_tags %}
in your templates.
Renders a navigation menu normally used as part of footer navigation element. Utilizes foundry.models.Link objects configurable via Menu Preferences in admin to provide a flexible menu navigation system. Elements are ordered using position values as specified on foundry.models.LinkPosition objects via admin. You can customize the resulting HTML by overriding the foundry/inclusion_tags/menu.html
template file. The template receives an object_list
context variable, which is a collection of ordered foundry.models.Link elements to display.
Renders a navigation bar normally used as part of main navigation element positioned at top of pages. Utilizes foundry.models.Link objects configurable via Navbar Preferences in admin to provide a flexible navbar system. Elements are ordered using position values as specified on foundry.models.LinkPosition objects via admin. You can customize the resulting HTML by overriding the foundry/inclusion_tags/navbar.html
template file. The template receives object_list
and active_link
context variables. object_list
is a collection of ordered foundry.models.Link elements to display and active_link
is an foundry.models.Link object determined to be active for the requested path.