Back

Change the Page Title and Crumbtrail Title based on URLMapContent

Description

This snippet shows how to check for URLMapContent in your Template, and change the page title and crumbtrail title accordingly.  

If you have multiple URLMaps and they each use a different field for the title, you can also check for the folder or page name in the $VTLSERVLET_URI variable.

You would put this code at or near the top of your template before your print out the page title.  

Code

#if($URLMapContent.inode)
  #set($pageTitle = $URLMapContent.title)
  #set($crumbTitle = $URLMapContent.title)
#elseif($UtilMethods.isSet($friendlyName))
  #set($pageTitle = $friendlyName)
  #set($crumbTitle = $friendlyName)
#end