Skip to main content

django-cms-autoblocks

Django-cms-autoblocks is an app that allows you to place arbitrary content blocks into your templates, so that you can take advantage of django-cms placeholders in the templates for your custom apps, without having to include django-cms as a requirement for your custom app (because the django-cms dependency is introduced at the template level by the template author).

Installation

From PyPi: pip install autoblocks

From GitHub: pip install git+git@github.com:Strathcom/django-cms-autoblocks.git

Setup

  1. Add autoblocks to settings.INSTALLED_APPS.

  2. Run manage.py syncdb.

  3. If you want to do frontend editing, add the dependencies for the django-cms toolbar to your templates.

Usage

In your template:

{% load autoblocks_tags %}
{% autoblock 'this is my auto block' %}
{% autoblock 'this is' 'also' 'an autoblock' %}
{% autoblock 'blurb-' model_instance.id %}
{% autoblock 'blurb-' model_instance.id on site %}
{% autoblock 'blurb-' model_instance.id on site as foo %}

The templatetag will generate an Autoblock with a placeholder field for you to work with tied to either the current site (Site.objects.get_current()), or the site instance you pass in when you use the {% autoblock ... on <site> %} variation of the tag.

Extras

If you add django.core.context_processors.request to settings.TEMPLATE_CONTEXT_PROCESSORS, autoblocks will only be created when the page is accessed by an authenticated user with the autoblocks.add_autoblock permission.

Autoblocks - Roll Out!

Release files for autoblocks 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autoblocks 1.0.4
File Size Uploaded
autoblocks-1.0.4.tar.gz 3.4 kB Details

Release files / autoblocks-1.0.4.tar.gz

Download URL autoblocks-1.0.4.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
397e31b8443f6502841aa6220b5e46bdf68739dd3ada2e1456dedee188dce5ba
BLAKE2b-256 checksum
How to use checksums
b4494f9322e34b6e4826aeb88ec933959f2106b67ef93fa49d33662f4f07851b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page