{
"info": {
"author": "Martin Aspeli",
"author_email": "optilude@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Plone",
"Framework :: Plone :: 4.3",
"Framework :: Plone :: 5.0",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: 5.2",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "===========\nplone.tiles\n===========\n\n.. image:: https://secure.travis-ci.org/plone/plone.tiles.png?branch=master\n :alt: Travis CI badge\n :target: http://travis-ci.org/plone/plone.tiles\n\n.. image:: https://coveralls.io/repos/plone/plone.tiles/badge.png?branch=master\n :alt: Coveralls badge\n :target: https://coveralls.io/r/plone/plone.tiles\n\n``plone.tiles`` implements a low-level, non-Plone/Zope2-specific support for creating \"tiles\".\n\n.. contents::\n\n\nIntroduction\n============\n\nFor the purposes of this package,\na tile is a browser view and an associated utility providing some metadata about that view.\nThe metadata includes a title and description,\nan 'add' permission and optionally a schema interface describing configurable aspects of the tile.\nThe idea is that a UI (such as Mosaic) can present the user with a list of insertable tiles and optionally render a form to configure the tile upon insertion.\n\nA tile is inserted into a layout as a link:\n\n.. code-block:: xml\n\n \n\nThe sub-path (``tile1`` in this case) is used to set the tile ``id`` attribute.\nThis allows the tile to know its unique id, and, in the case of persistent tiles, look up its data.\n``sample.tile`` is the name of the browser view that implements the tile.\nThis is made available as the ``__name__`` attribute.\nOther parameters may be turned into tile data, available under the ``data`` attribute, a dict, for regular tiles.\nFor persistent tiles\n(those deriving from the ``PersistentTile`` base class),\nthe data is fetched from annotations instead,\nbased on the tile id.\n\nThere are three interfaces describing tiles in this package:\n\n``IBasicTile``\n is the low-level interface for tiles.\n It extends ``IBrowserView`` to describe the semantics of the ``__name__`` and ``id`` attributes.\n``ITile``\n describes a tile that can be configured with some data.\n The data is accessible via a dict called ``data``.\n The default implementation of this interface, ``plone.tiles.Tile``,\n will use the schema of the tile type and the query string (``self.request.form``) to construct that dictionary.\n This interface also describes an attribute ``url``,\n which gives the canonical tile URL,\n including the id sub-path and any query string parameters.\n (Note that tiles also correctly implement ``IAbsoluteURL``.)\n``IPersistentTile``\n describes a tile that stores its configuration in object annotations,\n and is needed when configuration values cannot be encoded into a query string.\n The default implementation is in ``plone.tiles.PersistentTile``.\n To make it possible to have several tiles of a given type on the same layout,\n the annotations are keyed by the tile ``__name__``.\n\nInternally tiles are described by ``ITileType``.\nIt contains attributes for the tile name, title, description, add permission and schema (if required).\n\nA properly configured tile consists of\n\n- a utility providing ``ITileType`` with the same name as the tile browser view.\n- a browser view providing ``IBasicTile`` or one of its derivatives.\n\nThe directive ``
Hello world
'\n\nNote that the tile is expected to return a complete HTML document.\nThis will be interpolated into the page output according to the following rules:\n\n* The contents of the tile's ``My tile'\n\nThe tile is a browser view:\n\n.. code-block:: python\n\n >>> from plone.tiles.interfaces import ITile\n >>> ITile.implementedBy(SampleTile)\n True\n\n >>> from zope.publisher.interfaces.browser import IBrowserView\n >>> IBrowserView.implementedBy(SampleTile)\n True\n\nThe tile instance has a ``__name__`` attribute\n(normally set at class level by the ```` section is appended to the output document's ``
`` section.\n* The contents of the tile's ``
`` section will replace the tile placeholder as indicated by the tile link.\n\nNote that this package does *not* provide these interpolations.\nFor a Plone implementation of the interpolation algorithm, see `plone.app.blocks`_.\n\nIf you require a persistent tile, subclass ``plone.tiles.PersistentTile`` instead.\nYou may also need a schema interface if you want a configurable transient or persistent tile.\n\nTo register the tile, use ZCML like this:\n\n.. code-block:: xml\n\n
with any required resources,\nand a
with the visible part of the tile.\nThis will then be merged into the page, using a system such as ``plone.app.blocks``.\n\nThe API in this package provides support for tiles being configured according to a schema,\nwith data either passed on the query string (transient tiles) or retrieved from annotations (persistent tiles).\n\nNote that there is no direct UI support in this package,\nso the forms that allow users to construct and edit tiles must live elsewhere.\nYou may be interested in ``plone.app.tiles`` and ``plone.app.mosaic`` for that purpose.\n\nTo use the package, you should first load its ZCML configuration:\n\n.. code-block:: python\n\n >>> configuration = \"\"\"\\\n ...