cancel
Showing results for 
Search instead for 
Did you mean: 

How to add new field to a single page template

Former Member
0 Kudos

I have created a new template to be used in content page creation. In our *-items.xml file, I have modified the ContentPage before to add additional fields that you can set in the Hybris CMS, but I would like to add a field that is only visible if the new template is used.

The template is for a specific layout and has a call to google fonts, which will allow the creator of the page to enter a list of font families that would only be available on this new page. The variable would be in the script tag that makes to call to google fonts with the specified font family names. Like this:

Variable: ${fontFamilyList}

 <jsp:attribute name="pageCss">
     <link href="https://fonts.googleapis.com/css?family=${fontFamilyList}" rel="stylesheet" />
 </jsp:attribute>

I know how to add a new field to all ContentPage templates and have done just that in a different project, but I do not know how to do this for a single template. Can this be done via the items.xml file?

Does anyone know how to do this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Steve,

I will give that a try and let you know how it works. Thanks for the suggestion. :)

Former Member
0 Kudos

Hi John - how about extending ContentPage with a new type such as RichContentPage - and add the field to that new type only - then create the templates you want to apply to only, based on RichContentPage ?