Class TemplateUtil


  • @ProviderType
    public final class TemplateUtil
    extends Object
    Utility functions for working with CQ Templates.
    • Method Detail

      • hasTemplate

        public static boolean hasTemplate​(@CheckForNull
                                          com.day.cq.wcm.api.Page page,
                                          @CheckForNull
                                          String templatePath)
        Determine if the page is of a particular template type. This method is null safe and works properly in the publish and author environments.
        Parameters:
        page - the page to check
        templatePath - the path of the template to check
        Returns:
        true if the page is of the defined template