Recent Submissions

Quartz Errors

If you are seeing errors like this after an upgrade, it means that quartz has serialized an object to the database in its job store that has changed...

Show a page and content as JSON

This code allows you to display the page information, template information and content on the page as a json object.  If you add this to the top...

Generate responsive image tag from image file path

This code allows you to generate a responsive image tag that uses "srcset" and "sizes" attributes using a file location on your dotCMS server (ie. "/path/to/myfile...

Select Field for Frontend REST Forms

The following snippet allows you to add a Select field to a Frontend Form that works with Content REST API. 

  • There are...

WYSIWYG Field for Frontend REST Forms

The following snippet allows you to add a WYSIWYG field to a Frontend Form that works with Content REST API. 

  • The $!{wysiwygField}...

dotCMS-inspector version 2.x

This is a simple tool to gather information about a running dotcms instance. This only works with dotcms 2.x releases

Usage: Must be run as root...

dotCMS-Inspector version 3.x

This is a simple tool to gather information about a running dotcms instance. This only works with dotcms 3.0 plus.

Usage: Must be run as root...

TinyMCE for 2.5.7 and 3.X

This is the plugin for a 2.5.7 or 3.x instance to extended the WYSIWYG.

Multi-lingual Navigation

Here is an example of how to do multi-lingual navigation using the navtool. You need to have your language keys set up and then make each page title...

Check if key/value field has content

This should be thought of as the equivalent of $UtilMethods.isSet. Unfortunately, that method always returns true for key/value pairs. So we need to...

Pull a dropdown list (select) of other content into a custom field

Use this code in a custom field, to pull a list of other content into a select field. This code uses the jQuery Javascript library in a way that shouldn't...

How to Display Content Type's Fields

On this example we will show how to use Velocity to display the values for each type of field on a content type.

We created a new structure and...

One liner for generating OSGi fragment export

When developing an OSGI plugin, you often (always) need to generate an OSGi "fragment" which takes the place of manually having to change the osgi-exports...

Show different WYSIWYG options based on Role

It is easy to show different WYSIWYG options based on a users role.  All you need to do is to write a plugin that overrides the file:

/dotCMS/html/portlet/ext/contentlet/field/tiny...

Upgrade to the latest Tomcat 6

The Dotcms 2.x distro is running a bit behind the latest apache tomcat 6 version and while Dotcms does not think that will cause any specific problem...

Navigation Macro based on dotCMS' navTool viewtool

This macro extends the functionality provided by dotCMS' navTool viewtool.

It is based on folders and will allow you to set a starting point...

Displaying Hints on Form Fields

If you want to display a hint for each of your Form fields you can do so by using the following Javascript snipet.

This example uses the Form's...

Comparing Dates in Velocity

This code sample will help you learn different ways to obtain today's date and format it. It also shows how you can compare two dates, or one content...

Using AND and OR to pull content by Categories

When pulling content by categories sometimes you need to match categories using an AND, or an OR or sometimes a combination of both.

The example...