Codeshare List of user-contributed code snippets for dotCMS Java CMS.

Author: "Chris Falzone"

Multi-lingual Navigation

Author: Christopher Falzone | Created: Feb 09, 2015

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 a ...

Date Looping

Author: Christopher Falzone | Created: Jun 18, 2013

This is how you can loop over a range of dates in velocity

Twitter4J Viewtool Example

Author: Christopher Falzone | Created: Apr 10, 2013

Just a quick Example of a Twitter4J viewtool.

Mobile Detection and Redirection

Author: Christopher Falzone | Created: Apr 03, 2013

Simple mobile detection and redirection in dotCMS

1.9 Orphaned htmlpage SQL

Author: Chris Falzone | Created: Sep 27, 2012

From time-to-time we still have clients come to us with orphaned files. Here are the queries I use to find/fix them.

Disable Structure Fields in Back-end UI

Author: Jonathan Laughlin | Created: Jun 11, 2012

This javascript, when placed into a custom field, will disable fields listed in the array fieldsToDisable. making them uneditable by back-end UI users.

Import Content (ContentletAPI Example)

Author: Chris Falzone | Created: Jun 08, 2012

From Chris Falzone - an example of importing content in dotCMS 1.7 using the ContentletAPI

Generate A Random Number with Limits

Author: Chris Falzone | Created: Mar 05, 2012

This simple snippet generates a random number between 1 and 5

Change the Page Title and Crumbtrail Title based on URLMapContent

Author: Brent Verkerk & Chris Falzone | Created: Feb 09, 2012

See how to check for URLMapContent in your Template, and change the page title and crumb-trail title accordingly.

Disable Crawler Traffic

Author: Chris Falzone | Created: Dec 23, 2011

The following snippet is a urlRewrite rule to disable traffic from a crawler. Just replace crawler agent with the User Agent of the crawler.

Topics

Have you created code you'd like to share with the dotCMS community?

Share your code Become a Contributor