|
Project Information
Members
Links
|
Snippetology lets you pull text snippets from the database and inject them into your Django templates (or directly into your view code). If text sounds boring, it shouldn't - the snippets can be any HTML content including flash or image tags, regular markup, CSS, Javascript, etc.. This is a very simple but commonly requested CMS feature, where content can be changed dynamically by a trusted non-technical administrator. Snippet text is editable from the regular Django admin panel and the output text appears anywhere you place the matching snippet tag in your template. A randomizing filter is also included that will let you randomly emit lines from a particular snippet. This can be handy for page taglines or rotating banner ads, etc. Install
Using Snippets
Randomizing SnippetsThe random_line tag will randomly select one line out of a snippet full of lines of text. Blank lines are ignored. To use the randomizing feature:
{% filter random_line %}{% snippet "rotating_banner_list" %}{% endfilter %}Important NotesSnippetology is appropriate to workgroup sites, intranets, and low volume public websites. Running unmodified on higher volume sites probably isn't a great idea because of the database hits you'd rack up. Caching support and other performance features are in the works but are not a priority at this time. Suffice it to say that if you're not running a high volume website you likely won't experience performance problems with Snippetology. Similar AppsApparently there is a strong desire for named snippets. There are several projects which provide similar functionality that you might find more useful:
|