A random paragraph from this page used to be displayed in the wiki footer. Single-paragraph, concrete, real-world tips were preferred.
Use the source, Luke.
Separate logic, presentation and content. You will be happy you did.
Regard Python Scriptss as design, not logic. Methods that change things belong on the object or in a tool, not in a script. (TTW developers can't change things ?)
If you are getting too clever with python code in Page Templates or DTML, consider moving it to a Python Scripts.
Copying and pasting a CMF content object resets the publish state to visible. To preserve state, cut it instead.
Fast way to learn DTML: test iteratively in a standard zwiki page with dtml enabled.
For more detail on DTML, TAL and other errors: use the error_log and event.log
To solve DTML and TAL puzzles: check API documentation; use zopectl debug
To monitor zope activity, set event.log level to BLATHER and keep windows open running tail -f on various Zope files and directories
To get an attribute without acquisition: obj.aq_base.attr_name. In restricted python: obj.aq_explicit.attr_name (but it's less thorough)
Enable tracebacks in /error_log and less -S +F event.log to monitor errors
Zope 2.7's event log is not good for diagnosing startup problems - use runzope instead
TAL paths like some/where/here will call here if it's callable, but not some or where
Translations of Plone product actions must be in the plone domain. Most plone products provide product-xx.po and plone-xx.po files.
mindlace: can't i push a dict onto the available names via < dtml-with > ?
jshell: you might have to do < dtml-with [name] mapping>
jshell: with < dtml-in>, you have to tell it mapping in order for it to use the __getitem__ protocol instead of __getattr__. And dtml-with is a specialized dtml-in, IIRC
To ensure zope will see an unchecked checkbox value in a form: add <input type="checkbox" type="hidden" name="VARNAME:default:boolean" value="">
(NB. or maybe a better way of doing this is:
<)input type="checkbox" name="VARNAME:boolean"> <input type="hidden" name="VARNAME:default:boolean">
When trying to submit a file, don't forget to add enctype="multipart/form-data" to your form tag and then you'll just have the file in an object: REQUEST.from['fileBeingUploaded'] (fileBeingUploaded being the id or name of the <input type="file"/>). The file will be similar to this one: http://docs.python.org/lib/bltin-file-objects.html
In mozilla/firefox, add this bookmark with a keyword like ??? for fast zope list searches: http://search.gmane.org/search.php?sort=date&group=zope&query=%s
jreynaga: how do I call a Page Template stored in my filesystem from a python module?
TinoW?: jreynaga: you use PageTemplateFile("path",globals()).__of__(context)()
ArnoPucher: Use stylesheets for presentation (http://www.w3.org/Style/CSS/)
To get the root object (or any object) in DTML or other restricted code: restrictedTraverse(/)
Start StructuredText? docs in column 0 or risk messed up display of literal blocks