Package: jmbo-banner
Jmbo BannerJmbo banner application. Banners are typically used to serve ads.ContentsJmbo BannerInstallationUsageContent typesBanner stylesAdding your own banner stylesGetting banners to render on a pageAuthorsChangelog1.00.60.50.40.30.2.60.2.50.2.4.40.2.4.30.2.4.20.2.4.10.2.40.2.30.2.20.2.10.20.1.30.1.20.1.10.10.0.6InstallationInstall or addjmbo-bannerto your Python path.Addbannerto yourINSTALLED_APPSsetting.Runmanage.py migrate banner.Usagejmbo-bannerallows users to create and edit banners in the admin. Each banner can optionally have a byline,
a description block, images and CTA buttons. The way in which these components are laid out in each banner is defined
in a banner style.Content typesjmbo-bannerdefines the following content types:Button:A banner can consist of several buttons, although usually only two are used.A button has atextfield which can be used to specify its label, and alinkobject which can be used to specify its click-through.Banner:A banner can be thought of as a container for promotional content. It can consist of buttons, images and promotional text. Each banner also has astylewhich controls how its contents are rendered.Banner stylesjmbo-bannerallows you to control how each banner will be rendered. The different ways in which a banner can be rendered can be found in a predefined list of styles.
A style controls how the different components (buttons, images, description) are rendered through atemplate partial.Adding your own banner stylesIt is sometimes necessary to have morestylesin which banners can be rendered. This can easily be achieved by adding a package,banner_configto one of your own
apps and ensuring that you create your custom style in astyles.pyfile. An example structure would be as follows:<your app>/
    ...
    banner_config/
        __init__.py
        styles.pyAll custom stylesshouldinherit fromBaseStyle. For most situations, overriding thetemplate_nameshould suffice.
It is important to bear in mind a style’s template is meant to be used as a partial containing only the banner content.frombanner.stylesimportBaseStyleclassCustomStyle(BaseStyle):"""
    Custom banner style
    """template_name="banner/custom_banner.html"TheCustomStyleshould then be available for selection in the list of styles.Getting banners to render on a pageBanners are typically rendered as part of a page. This can be achieved by using therender_bannertemplate tag as shown below. The template tag accepts either a
banner object or it’s slug.{% extends "base.html" %}
{% load banner_tags %}

{% block content %}
    {% render_banner<object_or_slug>%}
{% endblock %}AuthorsPraekelt ConsultingShaun SephtonJonathan BydendykHedley RoosPhala RamonyaiChangelog1.0Django 1.11 compatibility.RecreatedBannermodel with headline, body, and button components.Removeddjango-dfpdependency.0.6Django 1.6 compatibility.0.5Remove dependency onjmbo-foundry.Add tests.0.4Renameget_absolute_urlmethod toget_target_urlsince it was breaking Jmbo convention. If you have customizedimagebanner_*.htmlthen you need to update them.0.3Remove redundant tests.Use newer version ofdjango-dfp. If you have customizeddfpbanner_detail.htmlordfpbanner_list_item.htmlthen you need to update them.0.2.6If there is no actual banner and the banner proxy has no image set then don’t render anything.Cache templates.0.2.5Multiple banners that match a regex are now randomized to effect banner rotation.0.2.4.4# Hotfix. Split paths on any whitespace.0.2.4.3Hotfix. Skip over empty paths to avoid an exception.0.2.4.2Hotfix. Properly fall back to default banner if it is set.0.2.4.1Hotfix. Add missing migration.0.2.4Use search instead of match for regular expressions.A Banner Proxy now has an optional default banner.Consider query string when doing regex matching for Banner Proxies.0.2.3Add a BannerProxy model that inspects the URL and renders a banner designated to render for that URL.0.2.2DFP banners draw themselves when loaded via ajax. The code is in the new banner.js.0.2.1Hotfix release. Add missing files.Display error message in admin interface to notify of missing banner urls.0.2Google DFP banner functionality for web and mobi. This facilitates advertising and tracking using Google’s DFP service.urls.pycreated. Be sure to add it to your project urls.Dependency ondjango-dfp>=0.1.2.We now have South migrations.0.1.3Create list item templates for code banners.0.1.2Use correct photosize name.0.1.1Use olderjmbo-foundryAPI for image URLs.0.1Add dependency onjmbo-foundry>=0.7.0.0.6Fix incorrect photosizes.json