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

Author: "Christopher Falzone"

Multi-lingual Navigation

Author: Christopher Falzone |

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 |

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

Twitter4J Viewtool Example

Author: Christopher Falzone |

Just a quick Example of a Twitter4J viewtool.

Mobile Detection and Redirection

Author: Christopher Falzone |

Simple mobile detection and redirection in dotCMS

1.9 Orphaned htmlpage SQL

Author: Chris Falzone |

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 |

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 |

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

Generate A Random Number with Limits

Author: Chris Falzone |

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 |

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 |

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