Learn to use ZopeSkel and the extensibility of the underlying templer system to create skeleton templates that support your needs as a developer. Spend minutes instead of hours starting new projects so you can use your time for your customers' code.
22. from templer.plone.plone import Plone
class PolicyPackage(Plone):
summary = "My skeleton for policy packages"
help = "Control the customization of a project"
_template_dir = 'policypackage'
31. In Your Class
import copy # new
from templer.core.base import get_var # new
from templer.plone.plone import Plone
class PolicyPackage(Plone):
summary = "My skeleton for policy packages"
help = "Control the customization of a project"
_template_dir = 'policypackage'
vars = copy.deepcopy(Plone.vars) # new
get_var(vars, 'add_profile').default = True # new
get_var(vars, ‘add_profile’).modes = [] # new
33. import copy
In Your Class
from templer.core.base import get_var
from templer.core.vars import EASY
from templer.core.vars import StringVar
from templer.plone.plone import Plone
class PolicyPackage(Plone):
summary = "My skeleton for policy packages"
help = "Control the customization policy of a project"
_template_dir = 'policypackage'
vars = copy.deepcopy(Plone.vars)
get_var(vars, 'add_profile').default = True
get_var(vars, 'add_profile').modes = []
vars.append(
StringVar(
'add_on_profile',
'provide the name of an add-on profile to be installed',
modes=(EASY,),
),
)
45. Var
• Methods
• pretty_description
• further_help
• validate
46. Entry Point Categories
• paste.paster_create_template
• for templates you want users to run
• templer.templer_structure
• for structures users should never see
• templer.templer_sub_template
• for local commands