Best Practices
From OpenCms Wiki
(Difference between revisions)
Duckingham (Talk | contribs) m (fixed typo) |
|||
(One intermediate revision by one user not shown) | |||
Line 11: | Line 11: | ||
* Wrap your links within <cms:link>link</cms:link> tags. If this is forgot renaming of the webapplication or static export or moving will not work. | * Wrap your links within <cms:link>link</cms:link> tags. If this is forgot renaming of the webapplication or static export or moving will not work. | ||
− | * Don't play | + | * Don't play much with Apache, Tomcat and OpenCms configuration. Try to use the standard examples with mod_jk as shown in [[Opencms_as_/_with_APache_%2B_modjk_(or_mod_proxy))]]. |
− | * Try to use JSTL code with Expression Language instead of scriptlet code. It's better to maintain. You have full Expression | + | * Try to use JSTL code with Expression Language instead of scriptlet code. It's better to maintain. You have full Expression Language access to OpenCms via the <cms:contentaccess> - Tag. |
Latest revision as of 19:05, 22 December 2009
- Try to re-use existing components (the TemplateOne system, downloadable modules) whereever possible. The temptation is to re-invent rather than to adopt existing components, which will often take significant time.
- Leverage properties where possible, instead of using hard-coded values. Properties can be set at the root of a site and cascade downwards, allowing much more flexibility.
- Use structured documents sparingly; make sure that any complex document type is thoroughly designed prior to loading your content. It can be very difficult to migrate from one XSD structure to another, more complex form.
- Consider your template architecture carefully. A simple page skeleton that uses properties to dynamically load in references to style sheets, javascript, global navigation, and sidebars can be quite powerful.
- Don't optimize too soon. OpenCMS has many ways to tune its performance once you get to launch. Don't write stupid code in your scriptlets, but don't kill yourself solving problems until you're sure you actually have them.
- Wrap your links within <cms:link>link</cms:link> tags. If this is forgot renaming of the webapplication or static export or moving will not work.
- Don't play much with Apache, Tomcat and OpenCms configuration. Try to use the standard examples with mod_jk as shown in Opencms_as_/_with_APache_+_modjk_(or_mod_proxy)).
- Try to use JSTL code with Expression Language instead of scriptlet code. It's better to maintain. You have full Expression Language access to OpenCms via the <cms:contentaccess> - Tag.