Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > Plone Extensions

    wildcard.templatedviews 1.0 Beta 4

    Download button

    No screenshots available
    Downloads: 185  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Nathan Van Gheem | More programs
    GPL / FREE
    August 30th, 2012, 09:12 GMT [view history]
    ROOT / Internet / Plone Extensions

     Read user reviews (0)  Refer to a friend  Subscribe

    wildcard.templatedviews description

    Provide templated views with schema settings associated with them

    wildcard.templatedviews is a Plone product that 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. Easy template that you fill in the settings for, can then be reference 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 >

    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.


    Product's homepage

    Requirements:

    · Python
    · Plone CMS

    What's New in This Release: [ read full changelog ]

    · Fix use of transform

      


    TAGS:

    Plone schemas | Plone templates | Plone | templates | schemas

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM