Search in sources :

Example 1 with HeroComponentInfo

use of uk.nhs.digital.common.components.info.HeroComponentInfo in project hippo by NHS-digital-website.

the class HeroComponent method doBeforeRender.

@Override
public void doBeforeRender(HstRequest request, HstResponse response) {
    super.doBeforeRender(request, response);
    HeroComponentInfo componentInfo = getComponentParametersInfo(request);
    final String size = componentInfo.getSize();
    final String textAlignment = componentInfo.getTextAlignment();
    final Boolean colourBar = componentInfo.getColourBar();
    HippoBean document = getHippoBeanForPath(componentInfo.getDocument(), HippoBean.class);
    String colour = componentInfo.getColour();
    if ("Dark Blue".equalsIgnoreCase(colour)) {
        request.setAttribute("colour", "Dark Blue Multicolour");
    } else {
        request.setAttribute("colour", colour);
    }
    request.setAttribute("document", document);
    request.setAttribute("size", size);
    request.setAttribute("textAlignment", textAlignment);
    request.setAttribute("displayColourBar", colourBar);
    request.setAttribute("stripTagsContentRewriter", stripTagsContentRewriter);
    request.setAttribute("brContentRewriter", brContentRewriter);
}
Also used : HippoBean(org.hippoecm.hst.content.beans.standard.HippoBean) HeroComponentInfo(uk.nhs.digital.common.components.info.HeroComponentInfo)

Aggregations

HippoBean (org.hippoecm.hst.content.beans.standard.HippoBean)1 HeroComponentInfo (uk.nhs.digital.common.components.info.HeroComponentInfo)1