{% extends "admin/base_site.html" %} {% load i18n %} {% block bodyclass %}grp-doc{% endblock %} {% block content-class %}{% endblock %} {% block title %}Grappelli Documentation » Object-Tools{% endblock %} {% block extrahead %} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %}

Object-Tools

The object-tools define actions which apply directly to an object.

Location

They appear on the right-hand side within #grp-content-title and are currently used with changelists and changeforms.

Title of your object

{% filter force_escape %}

Title of your object

{% templatetag openblock %} block object-tools {% templatetag closeblock %}{% templatetag openblock %} endblock {% templatetag closeblock %}
{% endfilter %}

Basics

The object-tools are defined in a block {% templatetag openblock %} block object-tools {% templatetag closeblock %}. They are always written as a ul.grp-object-tools wrapping another block {% templatetag openblock %} block object-tools-items {% templatetag closeblock %} which contains li and a elements defining the options.

Title of your object

{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    
    {% templatetag openblock %} block object-tools-items {% templatetag closeblock %}
  • Object-Tools Item
  • Object-Tools Item
  • {% templatetag openblock %} endblock {% templatetag closeblock %}
{% templatetag openblock %} endblock {% templatetag closeblock %} {% endfilter %}

Item Types

There are different types of items which, defined by additional classes for the a element. The default item is not further specified. The item for adding something (usually used on changelists) gets the class .grp-add-link. The item for viewing something outside the admin (usually used on changeforms) gets the class .grp-viewsite-link, but stylewise it's recognized by its attribute target="_blank". All links with such a target are handled as external links.

{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    
{% templatetag openblock %} endblock {% templatetag closeblock %}
{% endfilter %}

Item States

By default the items visually appear in a reduced state. Add .grp-state-focus to elements you want to emphasize.

Title of your object

{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    
    {% templatetag openblock %} block object-tools-items {% templatetag closeblock %}
  • Item
  • Focused Item
  • {% templatetag openblock %} endblock {% templatetag closeblock %}
{% templatetag openblock %} endblock {% templatetag closeblock %} {% endfilter %}
{% endblock %}