Personal tools
You are here: Home Documentation Tutorials Customizing AT View Templates Conclusion
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Conclusion

Some final notes about customizing Archetypes view templates

Floyd May

This tutorial describes the steps to produce a fully-customized view of an Archetypes object. This is applicable to tweaking little details of the default AT behavior as well as gutting and re-building the view from scratch.
Page 5 of 6.

So, now you should know all of the following information:

  • How to identify which parts of an Archetypes view template are generated by the header,body,folderlisting, and footer macros
  • How to create a custom view template that overrides one or more of the header,body,folderlisting, and footer macros
  • How to create a custom widget template that works in the Archetypes framework
  • How to create a custom body template that uses Archetypes' widget rendering templates
  • How to inject custom CSS code and links to custom CSS files into your view template

Some Final Notes

I want to cover a few details about how to apply all of these tools. Some wise guy somewhere said something like, "To a man whose only tool is a hammer, every problem tends to look like a nail." Your success with Archetypes is very contingent upon selecting the appropriate tool for your specific problem. So, use the following outline of the basic AT page layout as a guideline to determine what should be customized:

  • header macro
    • Title (or id if no title is present)
    • Document actions (e.g. print, send to)
  • body macro
    • List of fields
      • Field label (from the label macro in the view template, if one exists)
      • Field value (from the widget template's view macro)
  • folderlisting macro
    • List of links to each sub-object
  • footer macro
    • byline

So, based on which parts of this standard layout you need to customize, use the appropriate macro. Keep the infamous "Foo" template around to help you with debugging. See the next page for a reference on customizing Archetypes view templates.

 
by Floyd May last modified April 27, 2006 - 19:30 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by