{% load generic_flatblocks %} {% comment %} Let's create an flatblock with a "as" argument. We publish this block at the end of this page in a variable called FOOTER {% endcomment %} {% gblock "footer" for "gblocks.Text" as "FOOTER" %} My shiny example project

See the template sources for further details.

{% comment %} You can join unlimited of slug-strings or context-variables to one slug. Most commonly you will do this if you need to use the users LANGUAGE_CODE in your slug, to have different content nodes for every language. {% endcomment %} {% gblock "website","title",LANGUAGE_CODE for "gblocks.Title" %} {% comment %} The slug can also be a context variable. {% endcomment %} {% with "website_teaser" as my_slug %} {% gblock my_slug for "gblocks.Text" %} {% endwith %} {% comment %} You can always render each generic block with a template of your choice, {% endcomment %} {% gblock "website_urgent_notice" for "gblocks.Text" with "urgent.html" %} {% comment %} You can pass an integer as slug. In this case, generic-flatblocks will fetch the model instance with the primary key you named in slug. Basically this is a {% include %} tag on model level. {% endcomment %} {% gblock 1 for "auth.user" with "current_user.html" %} {% comment %} You can store the related object directly in the context using the "into" argument. This is the quickest way to display any model. The "for" and "as" arguments are ignored. {% endcomment %} {% gblock 1 for "auth.user" into "the_user_object" %}

The first user is {{ the_user_object.username }}!

{% if the_user_object_admin_url %}edit{% endif %}
{% comment %} Here is the FOOTER content node we defined above. {% endcomment %} {{ FOOTER }}