Giter VIP home page Giter VIP logo

viewlets_dont_suck's Introduction

Introduction

https://github.com/aclark4life/viewlets_dont_suck/raw/master/viewlets_dont_suck.png

Viewlets don't suck! They are just really annoying.

Explanation

This is a small Plone viewlet tutorial that adds/removes a bit of template code to the portal top viewlet manager. The tongue-in-cheek title refers to the following:

  • In essence, viewlets are really cool. They allow you to customize any part of a Plone page without touching any Plone code.
  • In practice, they are a bit harder to work with than they should be (in the author's opinion) due to but not limited to the following reasons (some of which may be limitations of Plone):
    • They require GenericSetup [1]
    • They require a Python package [2]
    • They require an understanding of the ZCA [3]

Steps

The goal of this package is to add/remove a viewlet as quickly as possible. The steps are roughly:

  1. Create a Python package (viewlets_dont_suck)
  2. Create namespace packages (they.are.just.really.annoying)
  3. Create generic setup profiles (default AKA install, uninstall)
  4. Create ZCML to configure viewlet (added to the portal top viewlet manager)
  5. Create template (viewlets_dont_suck.pt)
  6. Add GS code to hide the viewlet on uninstall (is there any more we can do?)
  7. Add Python code to call the GS code to hide the viewlet (Extensions/install.py)
  8. Add GS code to customize the order on install (last but not least)
[1]Technically, they don't; i.e. you can add viewlets and viewlet managers with ZCML.
[2]Technically, they don't; i.e. you can add ZCML without a Python package via the plone.recipe.zope2instance recipe, but GenericSetup requires a Python package (to register a directory full of XML configuration).
[3]ZCA is Zope Component Architecture. Viewlet managers provide an interface that viewlets may configure themselves to use (via manager=<INTERFACE> in ZCML)

viewlets_dont_suck's People

Contributors

aclark4life avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.