Documentation Center

Modifying HTML Templates

You can add new HTML templates to your skin, or modify existing templates to change the appearance and layout of your pages.

About this task

Modifying existing HTML templates helps you change the display of the page. Common modifications include modifying the header and footer to include your company logo, links to legal notices or copyrights, or changing the main navigation structure of the application.

ContentDelivery_home refers to ContentDelivery_InstallDir\WEB-INF on Windows and ContentDelivery_InstallDir/WEB-INF on Linux.

Procedure

  1. Add a new HTML template to your skin, or copy an existing template from ContentDelivery_home/db/LiveContent/ui/skins/<your skin>/html/ into your skin.
  2. Ensure that the root element of your HTML template contains the lcui namepsace. This namespace is required to use the LCUI tag library.
    
    <div xmlns:lcui="http://www.sdlxysoft.com/LiveContent/UITags">
    ...
    </div>
    
  3. If the content of the HTML template should only be available to users with a specific permission, include the permission in the lcui:permission attribute.

    This example shows an HTML template restricted only to users with the lcui:permission permission.

    
    <div xmlns:lcui="http://www.sdlxysoft.com/LiveContent/UITags" lcui:permission="Manage application">
    ...
    </div>
    
  4. Modify the HTML template as needed. Refer to the About the Standard UI XSL and Tag Library for additional information on the LCUI tags.
    • Insert static HTML like div, span, and table elements as needed.
    • Use the lcui:string tag to insert localized strings. The lcui:string tag must be the only child of a element, including text elements.
    • Use the lcui:img tag to insert images.
    • Use the lcui:script tag to insert references to JavaScript files.
    • Use the lcui:css tag to insert references to CSS files.
    • Add content as a child of a <lcui:test key="loggedin"> element to create content that should only be displayed to logged in users.
    • Add content as a child of a <lcui:test key="notloggedin"> element to create content that should only be displayed to anonymous users.
    • Add content as a child of a <lcui:perm key="Manage application"> element to create content that should only be displayed to users who possess the specified permission.
    • Add content as a child of a <lcui:test key="internal_user_mode"> element to create content that should only be displayed if the application is configured to use Legacy Content Delivery users and groups as opposed to Single Sign-on.
  5. Upload the new skin customization into the database.
    • You can upload the resources using the web UI, as described by Adding a Skin and Resources.
    • You can also update the skins via the command line using the loaddb tool. Copy the updated skin resources from the source code repository to ContentDelivery_home/db/LiveContent/ui/skins/<your_skin>/.
      • On Windows, to load the most recent changes into the database run this command:

        loaddb.bat UPGRADE

      • On Linux, run this command:

        loaddb.sh UPGRADE