NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

XHTML/Facelets Basics

For all of the XHTML files that can be specified through the branding process, they MUST start withAll XHTML files should contain the following markup at the beginning:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets">

and they MUST finish up with:

Code Block

</ui:composition>
Code Block

Within the composition, almost any XHTML can be specified.&nbsp;

Entities

Code Block

The one exception to watch out for are entities such as non-breaking spaces.&nbsp; Including these directly will cause the rendering of the page to fail, and users will see a big mess in their browser.&nbsp; In other words &nbsp; will break rendering.&nbsp; Instead, the entity must be enclosed in a "verbatim" tag.&nbsp; Please note that another namespace is defined in the composition tag (in red below).
Code Block

<ui:composition xmlns:ui=http://java.sun.com/jsf/facelets

...

Image Added
xmlns:f="http://java.sun.com/jsf/core">

...


<f:verbatim>&nbsp;</f:verbatim>

Then, finish up with:

...

</ui:composition>

...

Code Block