Getting WCM Content Custom Fields

This example shows how you can get custom fields from a WCM Content object. These are the fields belonging to a Content object that is setup in the Content’s Authoring Template.

If you are unfamiliar with WCM or how you can leverage the WCM API in Java on the server side, you can refer to the links here:

Getting WCM Content in a SiteArea on the Server Side

 

WCM Content

In the snippet below, you will see how you can extract properties and components from the Content object.
Lets assume we created the following fields, and in the snippet we will be getting them by their unique name:

  • LinkComponent (mysite.custom.link) – to store a URL value
  • TextComponent (mysite.custom.text) – to store a text field value
  • OptionSelectionComponent (mysite.custom.options) – to store a Yes/No single selection value

 

LinkComponent

 

TextComponent

 

OptionSelectionComponent




References:

Leave a Reply

Your email address will not be published. Required fields are marked *