This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

This package allows you to define a set of views, schemas, and templates that can be used as templates for a view on a Plone site.

So basically, it just allows an easy mechanism to provide extra, reusable templates that have settings attached to them. Each template that you fill in the settings for, can then be referenced from another template view on the site elsewhere.

Basic example

Define your settings:

>>> class ICustomSettings(Interface):
>>>     setting_one = schema.TextLine(title=u'Setting One')
>>>     setting_two = schema.Text(title=u'Setting Two', default=u'')

Define a template view utility:

>>> from wildcard.templatedviews.browser import BaseViewUtility
>>> from plone.app.form.widgets.wysiwygwidget import WYSIWYGWidget
>>> class CustomTemplateViewUtility(BaseViewUtility):
>>>     settings = ICustomSettings
>>>     _for = None
>>>     title = u'Custom Template'
>>>     description = u'a custom template settings.'
>>>     custom_widgets = (
>>>         ('setting_one', WYSIWYGWidget),
>>>     )

And wire it up with zcml:

>>> <browser:page
>>>   for="*"
>>>   name="custom-template"
>>>   class="wildcard.templatedviews.browser.BaseView"
>>>   template="templates/custom-template.pt"
>>>   permission="zope2.View"
>>> />
>>> <utility factory=".CustomTemplateViewUtility" name="custom-template" />
>>> <adapter
>>>   for="*"
>>>   provides=".ICustomSettings"
>>>   factory="wildcard.templatedviews.settings.TemplateViewSettings"
>>> />

Then in your custom-template.pt, you can use the settings like this:

>>> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
>>>       xmlns:tal="http://xml.zope.org/namespaces/tal"
>>>       xmlns:metal="http://xml.zope.org/namespaces/metal"
>>>       xmlns:i18n="http://xml.zope.org/namespaces/i18n"
>>>       lang="en"
>>>       metal:use-macro="here/main_template/macros/master"
>>>       i18n:domain="plone">
>>> <body>
>>>
>>> <metal:main fill-slot="main" tal:define="settings python: view.settings">
>>>   <tal:main-macro metal:define-macro="main">
>>>     <h1 tal:content="python: settings.setting_one" />
>>>     <p tal:content="structure python: settings.setting_two" />
>>>   </tal:main-macro>
>>> </metal:main>
>>> </body>
>>> </html>

You’ll also need to add the ‘templated-view’ view to the list of available views on the content type you’d like to use this for.

Now to use it after you’ve installed it, select “templated-view” from the display drop down, then use the “Select Template” and “Template Settings” to customize your templated view.

Check out the source for more examples on how to use it.

Changelog

1.0b4 (2012-08-27)

  • fix use of transform

1.0b3 (2012-08-09)

  • plone 4.1 compat
  • transform uids

1.0b2 (2011-10-25)

  • if traversing to object doesn’t work, try looking it up in the redirect storage

1.0b1 (2011-04-13)

  • provide save events for settings and selected template
  • allow ordering of fields

1.0a2 (2010-04-10)

  • fix issue when no utilty can be found
  • add more utility methods to view

1.0a1 (2011-03-20)

  • Initial release
Release History

Release History

1.0b4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0b3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0b2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0b1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0a2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0a1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wildcard.templatedviews-1.0b4.zip (27.5 kB) Copy SHA256 Checksum SHA256 Source Aug 27, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting