Blogs

Validating dotCMS Pages

Sep 01, 2009

By:

Validating dotCMS driven sites:

  1. Validate a page for each of your templates (without content). This will ensure all common errors are fixed across the site.
  2. Validate dynamic pages. The most frequent error we encounter is related to the & (ampersand) character since it's used to pass parameters through the URL and specify parameters for the resize_image and thumbnail methods; to fix the error, simply replace the & for the corresponding entity &.
  3. Validate static pages. At this point, since you have isolated all other issues, you can assume any other error is content related.

A few things to keep in mind:

Navigation: When using the \#navigation() macro, depending on how your top and left side navigation are declared, you may find repeated ids. For instance, if a folder called "Academics" is printed on both top and left navigation, the id "academics" will appear twice on the page, to avoid this, use the menu prefix parameter:
\#set($menuIdPrefix = "top") or \#set($menuIdPrefix = "left")

CSS: If validating your CSS, browser specific hacks won't work. An alternative is to use the css-browser-selector.js which inserts a class in the body tag and allows you to specify browser specific rules. Eg. .ie6 p{} or .gecko p{}

Macros: In cases where a macro prints the & character there are two solutions:

  1. Check macro documentation and source code and see if there is a way to specify a custom vtl file. Eg: Photo Gallery code can be overwritten:
    \#set($photoGallerySourceCode = '/application/velocity/photo_gallery.vtl')
  2. If there is no custom vtl file, a backend developer may need to change the macro

 

Useful Links:

HMTL Validator
CSS Validator
CSS Browser Selector
DotCMS: Thumbnail Images
Resized Images
DotCMS: Navigation Menu

Filed Under:

Recommended Reading

Headless CMS & Vue.JS Apps: Delivering Innovative Digital Experiences

The move towards SPA frontend frameworks like Vue, however, is largely driven by frontend developers, and often leaves marketers in the dark when it comes to managing the content-driven app.

Hybrid CMS and Taxonomies: A Deep Dive into dotCMS Search Capabilities

When choosing a CMS solution, one of the most critical things to look for is powerful search capabilities. We'll look at why search capabilities are crucial for a CMS, and how dotCMS provides powerful...

What is CCPA and What Does it Mean for Your Data Compliance & Content Management?

There’s a trend towards consumer data privacy regulations with GDPR in Europe and now CCPA in California. Are you taking the necessary steps to ensure your organization will remain compliant?

Headless Experience Management Done Right

Managing customer experiences in today’s omnichannel world can be hard if you don’t leverage the technology to do the work for you.