Usage of GoSCale template tags is optional but can provide some useful functionality.
Tag library for GoScale is called “goscale_tags”:
{% load goscale_tags %}
Provides a simple reusable pagination for GoScale plugin posts.
Simple case:
{% goscale_paginator %}
Custom template:
{% goscale_paginator template="infinite_scrolling.html" %}
Tag: goscale_paginator
Template: paginator.html
Keyword arguments:
Context variables:
Note: if you want a full unfiltered list of all pages just use {{ paginator.page_range }}
If your plugin uses any complex filters or query string params for it’s data you can use this tag to generate links to pass these filters to your plugin (or even all plugins on a page with the “global” param).
It renders the whole query string with added filters for the current plugin so any other query string params will be preserved. You can ignore this default behavior by using “exclusive” param.
One of the examples is in the paginator tag to generate page links and in calendar plugin to generate start date links.
Page link:
<a href="{% goscale_plugin_filters page=page.previous_page_number %}">{% trans "Prev" %}</a>
Calendar date example:
<a href="{% goscale_plugin_filters start=start_date global='true' exclusive='true' %}">{{start_date}}</a>
Tag: goscale_plugin_filters
Keyword arguments:
Used to render a link for a single post.
Simply an extension of Django CMS placeholder tag. It acts exactly the same but allows you to define if you want to render single posts into this placeholder.
For example if you want to render posts from “sidebar” placeholder plugins into “content” placeholder which can often be a case.
If you don’t use it you will still be able to access single posts inside of your plugin in a {{ post }} context variable.
Same result as Django CMS placeholder:
{% goscale_placeholder content %}
Placeholder where to render single posts:
{% goscale_placeholder content render_posts='true' %}
Tag: goscale_placeholder
Keyword arguments:
Simply an extension of django-sekizai addtoblock tag. It acts exactly the same but allows you to use it with AJAX requests.
If a CMS plugin where you use it will be rendered inside of an AJAX request it will simply render the contents of addtoblock tag instead of adding them into page context which wouldn’t work with ajax anyway.
Renders a user bar for Login and Registration links and User Info.
Simple case:
{% goscale_user %}
Custom template:
{% goscale_user template="userbar.html" %}
Tag: goscale_user
Template: user/user.html
Keyword arguments:
Renders a Login Form to use outside of the /accounts/login/ page.
Simple case:
{% goscale_login %}
Custom template:
{% goscale_login template="custom_login.html" %}
Tag: goscale_login
Template: user/login.html
Keyword arguments: