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

Recent Submissions

https from the command line - quickly set up a openssl proxy for testing

It is often useful or required to use https rather than http in order to do development browser testing.

Show a page and content as JSON

Author: dotCMS |

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 of your...

Select Field for Frontend REST Forms

Author: Jose Orsini |

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

Combine multiple structure sources into the same content pull

Author: Jonathan Laughlin |

We have multiple news outlets on campus that ended up being created in different structures. When we wanted to syndicate these news sources onto one page...

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

Set Language by Site or Folder

Author: dotCMS Team |

Using a variable to set the language rather than the folder or site has the benefit of allowing a multi-lingual site to maintain a single information architecture...

One liner for generating OSGi fragment export

Author: dotCMS |

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

Internationalized URL Title code

Author: Kivi Shapiro |

The default url-title.vtl is ASCII-only: any characters that are not letters of the English alphabet (or a digit or a hyphen) are discarded.

Navigation Macro based on dotCMS' navTool viewtool

Author: DotCMS |

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

Log Configuration Portlet

Author: Jeremiah Weeden-Wright |

The Logging Portlet allows a CMS Administrator in dotCMS to dynamically set logging levels of classes and packages at runtime that are known to the dotCMS...