{ "info": { "author": "Martin Aspeli", "author_email": "optilude@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Programming Language :: Python" ], "description": "============\nIntroduction\n============\n\n`plone.app.theming`_ supports plugins that allow theme authors to bundle\nmore advanced functionality with their themes. This package contains two\nsuch plugins:\n\n* The ability to override specific Zope Page Templates when a theme is enabled\n* The ability to register views providing custom markup using Zope Page\n Templates when a theme is enabled\n\nBoth of these *only* work for themes distributed on the filesystem (either in\na Python package or in the global ``themes`` resource directory), i.e. not\nfor themes imported through-the-web in ZIP archives. That said, the features\nprovided by these plugins are more likely to be useful in building \"customer\"\nsites (where filesystem development is likely to be the norma) than in\ndistributing generic themes (where the through-the-web ZIP import is more\nattractive).\n\n.. contents:: Contents\n\nInstallation\n============\n\nThemes that rely on the plugins described below will still work even if\nthis package is not installed: the plugin configuration will simply be\nignored.\n\nTo enable these plugins, the ``plone.app.themingplugins`` package must be\nenabled in the buildout. You can achieve this in one of two ways:\n\n* By listing ``plone.app.themingplugins`` in the ``eggs`` list used by the\n Zope instances in your ``buildout.cfg`` file.\n* By adding ``plone.app.themingplugins`` to the ``install_requires`` list in\n the ``setup.py`` file for a package that is installed in your buildout,\n for example a package used to house your theme or site policy.\n\nQuick Example\n=============\n\nAssuming you are developing a diazo theme called my.theme, do the following \nto override the logo viewlet when your diazo theme is activated:\n\n* add ``plone.app.themingplugins`` to the ``install_requires`` list in\n ``src/my.theme/setup.py`` \n* To override the logo viewlet add ``plone.app.layout.viewlets.logo.pt`` \n to src/my.theme/my/theme/theme/overrides and modify as required.\n\nThe plugins\n===========\n\nA Diazo theme works by transforming the content that is generated by Plone\n(or another system). So long as the requires information is output, there is\nvirtually no limit to how it can be transformed into the themed output.\n\nIf the information isn't there, however, you will need to extract it somehow,\nusually through a page template. This can be done using views in a standard\nPython distribution, but ``plone.app.themingplugins`` provides two simplified\nmechanisms that only require knowledge of TAL, the syntax of Zope Page\nTemplates.\n\nZope Page Template overrides\n----------------------------\n\nWhen distributing themes in a resource directory on the filesystem, it is\npossible to override existing Zope Page Template templates on an ad-hoc basis\nwhen the theme is enabled. This can be useful if you need to change the data\nbeing provided by Plone in a view, viewlet or other template-based resource.\n\nThis functionality relies on `z3c.jbot`_. To use it, add a directory named\n``overrides`` to the root of your theme resource directory. In this directory,\nyou can place page template files using the naming convention\n``..pt`` to override the template originally found in\n``.pt`` in the package ````.\n\nFor example, to override ``logo.pt`` in ``plone.app.layout.viewlets``, which\nis found in ``plone/app/layout/viewlets/logo.pt`` inside the\n``plone.app.layout`` distribution, you would copy ``logo.pt`` into the\n``overrides`` directory as ``plone.app.layout.viewlets.logo.pt``. You can then\nmodify this as required.\n\n **Note:** Templates are loaded at Zope startup. In debug mode, template\n changes are reflected on the fly, but you will need to restart Zope to\n pick up new templates.\n\nThe overrides directory name can be changed in the theme's ``manifest.cfg`` file\nif required::\n \n [theme:overrides]\n directory = template-overrides\n \nThe directory name is relative to the theme directory.\n\nRegistering new views from Zope Page Templates\n----------------------------------------------\n\nWhen distributing themes in a resource directory on the filesystem, it is\npossible to register new views based on Zope Page Templates which are\navailable when the theme is enabled.\n\nThis can be useful for generating additional dynamic markup based on Plone\ncontent or settings, usually for use with an ``href`` on a theme rule, e.g.\nto generate a custom navigation structure or some other dynamic content.\n\n **Note:** This style of view registration is not intended to contain complex\n logic. For more advanced use cases, you are advised to create a Python\n distribution and register a standard browser view.\n\nTo create new views, add a directory ``views`` to the root of your theme\nresource directory and place any number of ``*.pt`` files here.\n\nFor example, say you had a file ``custom-menu.pt`` in the ``views`` directory\ncontaining (a somewhat frivolous example)::\n\n \n\n(The variables ``context`` and ``request`` will work as normal in the page\ntemplates.)\n\nYou could then use a rule like::\n\n \n\nThis will replace ``#menu`` in the theme with ``#menu`` in the output of\nrendering the ``custom-menu.pt`` template.\n\n **Note:** If you invoke the ``@@custom-menu`` view when the theme is not\n enabled, you will get a ``404 NOT FOUND`` error. This is because the view\n is registered to a browser layer that is dynamically generated for the theme\n and automatically applied only when the theme is enabled.\n\nBy default, the view name is the template name, minus the ``.pt`` extension.\nThe view requires the standard ``View`` permission (``zope2.View``), and is\navailable for all contexts (``for=\"*\"``).\n\nThese defaults can be overridden by placing a file ``views.cfg`` in the\n``views`` directory. This should contain one section per template, where the\nsection name is the template name minus the ``.pt`` extension. The valid\noptions in each section are:\n\n* ``name``, to change the view name\n* ``permission``, to give a different permission name\n* ``for``, to change the view's context\n* ``class``, to let the view re-use an existing view class\n\nFor example::\n\n # for my-view.pt:\n [my-view]\n name = my-view-at-root\n for = Products.CMFCore.interfaces.ISiteRoot\n permission = cmf.ManagePortal\n class = some.package.browser.MyView\n\nAll options are optional, as is the ``views.cfg`` file itself.\n\n **Note:** Templates are loaded at Zope startup. In debug mode, template\n changes are reflected on the fly, but you will need to restart Zope to\n pick up new templates.\n\nThe views directory name can be changed in the theme's ``manifest.cfg`` file\nif required::\n \n [theme:views]\n directory = template-views\n \nThe directory name is relative to the theme directory.\n\n.. _plone.app.theming: http://pypi.python.org/pypi/plone.app.theming\n.. _z3c.jbot: http://pypi.python.org/pypi/z3c.jbot\n\nChangelog\n=========\n\n1.1 (2019-04-26)\n----------------\n\n- Python 3 compat, code-style.\n [jensens]\n\n1.0 (2015-08-20)\n----------------\n\n- Fix parsing of views plugin settings\n [tlyng]\n\n- Add `Quick Example` section to REAMDE\n [djowett]\n\n\n1.0b1\n-----\n\n- Initial release spun off from plone.app.theming\n [optilude]", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/plone.app.theming.plugins", "keywords": "plone.app.theming diazo jbot views", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "plone.app.themingplugins", "package_url": "https://pypi.org/project/plone.app.themingplugins/", "platform": "", "project_url": "https://pypi.org/project/plone.app.themingplugins/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/plone.app.theming.plugins" }, "release_url": "https://pypi.org/project/plone.app.themingplugins/1.1/", "requires_dist": null, "requires_python": "", "summary": "Plugins providing advanced plone.app.theming integration", "version": "1.1" }, "last_serial": 5191931, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9415b7f27ff2d0bd0c0a2a3084a800a6", "sha256": "ecc399979f77aedf7cf4eb01c1dde845df487324cbc2ed178eaf4babaff521e7" }, "downloads": -1, "filename": "plone.app.themingplugins-1.0.zip", "has_sig": false, "md5_digest": "9415b7f27ff2d0bd0c0a2a3084a800a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38380, "upload_time": "2015-08-20T12:42:30", "url": "https://files.pythonhosted.org/packages/60/15/7cbd935ae663668000a9aaa52c7c9a7d8f29d7dc3c71849433ed06111960/plone.app.themingplugins-1.0.zip" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "cfeca05053b49aa68c36055474cd81c7", "sha256": "6912b86cf05a146ccbf0da50350b1d50fe80a12388ab2f6813b58cdcd17da91f" }, "downloads": -1, "filename": "plone.app.themingplugins-1.0b1.zip", "has_sig": false, "md5_digest": "cfeca05053b49aa68c36055474cd81c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29741, "upload_time": "2011-06-12T13:44:39", "url": "https://files.pythonhosted.org/packages/96/ab/d1c8a89df696ca06ced60a6c2f3cccf63f1cae47bc5c67c22b8c14e774ba/plone.app.themingplugins-1.0b1.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "846aecf0ede5452579ed39dbfe042c10", "sha256": "e89cff0429f2abc2a9948e1ba6672ce8f07a51308a6ff02672a5c2a7fc56f2ae" }, "downloads": -1, "filename": "plone.app.themingplugins-1.1.tar.gz", "has_sig": false, "md5_digest": "846aecf0ede5452579ed39dbfe042c10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20155, "upload_time": "2019-04-26T09:35:13", "url": "https://files.pythonhosted.org/packages/bb/9e/097e6a264f3764c943b12324bf31578554ea9dfc93bb72799dedf514a77c/plone.app.themingplugins-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "846aecf0ede5452579ed39dbfe042c10", "sha256": "e89cff0429f2abc2a9948e1ba6672ce8f07a51308a6ff02672a5c2a7fc56f2ae" }, "downloads": -1, "filename": "plone.app.themingplugins-1.1.tar.gz", "has_sig": false, "md5_digest": "846aecf0ede5452579ed39dbfe042c10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20155, "upload_time": "2019-04-26T09:35:13", "url": "https://files.pythonhosted.org/packages/bb/9e/097e6a264f3764c943b12324bf31578554ea9dfc93bb72799dedf514a77c/plone.app.themingplugins-1.1.tar.gz" } ] }