Customizing the Header and Footer

Customize the default B2C Accelerator header and footers supplied with the accelerator template to suit your needs.

Context

Variables:

Variable Name Description Value

<${addOnName}>

The name of the AddOn

b2ctelcostorefront

<${addOnPageRoot}>

The location where custom page fragments must go

b2ctelcostorefront/acceleratoraddon/web/webroot/WEB-INF

Available template files:

File Name Source Path Target Path

Layout

/yacceleratorstorefront/web/webroot/WEB-INF/views/desktop/pages/layout/contentLayout1Page.jsp

<${addOnPageRoot}>/views/desktop/pages/layout/myNewLayoutPage.jsp

Page Template

/yacceleratorstorefront/web/webroot/WEB-INF/tags/desktop/template/page.tag

<${addOnPageRoot}>/tags/desktop/template/page.tag

Header

/yacceleratorstorefront/web/webroot/WEB-INF/tags/desktop/common/header/header.tag

<${addOnPageRoot}>/tags/desktop/common/header/header.tag

Footer

/yacceleratorstorefront/web/webroot/WEB-INF/tags/desktop/common/footer/footer.tag

<${addOnPageRoot}>/tags/desktop/common/footer/footer.tag

Procedure

Create Custom JSP Files

  1. Create a new page template based on the template file of the page type you need to customize.

    Copy an existing template. For example, if you want to customize the layout, copy /yacceleratorstorefront/web/webroot/WEB-INF/views/desktop/pages/layout/contentLayout1Page.jsp to $<{addOnPageRoot}>/views/desktop/pages/layout/myNewLayoutPage.jsp.

  2. At the top of the layout page, change the reference for the template taglib.

    For example, find the following:

    <%@ taglib prefix="template"
    						tagdir="/WEB-INF/tags/desktop/template" %>

    Then change it to:

    <%@ taglib prefix="template"
    						tagdir="/WEB-INF/tags/addons/${AddOnName}/desktop/template"
    						%>

Change the Header

  1. Change the reference for the header taglib.

    For example, find the following:

    <%@ taglib prefix="header" tagdir="/WEB-INF/tags/desktop/common/header"%>

    And change it to:

    <%@ taglib prefix="header" tagdir="/WEB-INF/tags/addons/${AddOnName}/desktop/common/header" %>

Change the Footer

  1. Change the reference for the footer taglib.

    For example, find the following:

    <%@ taglib prefix="footer" tagdir="/WEB-INF/tags/desktop/common/footer" %>

    And change it to:

    <%@ taglib prefix="footer" tagdir="/WEB-INF/tags/addons/${AddOnName}/desktop/common/footer" %>
    You can now directly customize the footer and header in your custom AddOn.