History | Edit

A WebHelp Responsive template component adds dynamics to a WebHelp template page. The rendering of a component depends on the context of where it is placed and its content depends on the transformed DITA map.

Some of the template components can be used in all the types of template pages, while some are only available for certain template pages. For instance, the Publication Title component can be used in all pages, but the Navigation Breadcrumb component can only be used in Topic Template pages.

To include a template component in the output of a particular type of template page, you have to reference a specific element in the particular template file. All the elements associated with a template component should belong to the http://www.oxygenxml.com/webhelp/components namespace.

Every component could contain custom content or reference another component. To specify where the component content will be located in the output you can use the component_content element as a descendant of the component element.

Example:
<whc:webhelp_search_input class="navbar-form wh_main_page_search"
              role="form" >
        <whc:include_html href="{$webhelp.include.before.search}"/>        
		<div class="search_input">
			<whc:component_content/>
		</div>
</whc:webhelp_search_input>

The various components and where they can be used are as follows:

Publication Title [webhelp_publication_title]

This component generates the publication title in the output. To generate this component, the webhelp_publication_title element must be specified in the template file. It can be used in all four types of template pages:

In the template file, the webhelp_publication_title element can be specified as in the following example:

<whc:webhelp_publication_title 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_publication_title.

Search Input [webhelp_search_input]

This component is used to generate the input widget associated with search function in the output. To generate this component, the webhelp_search_input element must be specified in the template file. It can be used in all four types of template pages:
In the template file, the wh_search_input element can be specified as in the following example:
<whc:webhelp_search_input 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_search_input.

Search Results [webhelp_search_results]

This component is used to generate a placeholder to signal where the search results will be presented in the output. To generate this component, the webhelp_search_results element must be specified in the template file. It can be used in the following type of template page:

In the template file, the webhelp_search_results element can be specified as in the following example:

<whc:webhelp_search_results 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_search_results.

Topic Breadcrumb [webhelp_breadcrumb]

This component generates a breadcrumb that displays the path of the current topic. To generate this component, the webhelp_breadcrumb element must be specified in the template file. It can be used in the following type of template page:
In the template file, the webhelp_breadcrub element can be specified as in the following example:
<whc:webhelp_breadcrumb 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_breadcrumb. This element will contain a list with items that correspond to the topics in the path. The first item in the list has a link to the main page with the home class. The last item in the list corresponds to the current topic and has the active class set.

Topic Content [webhelp_topic_content]

This component generates the content of a topic and it represent the content of the HTML files as they are produced by the DITA-OT processor. To generate this component, the webhelp_topic_content element must be specified in the template file. It can be used in the following type of template page:
In the template file, the webhelp_topic_content element can be specified as in the following example:
<whc:webhelp_topic_content 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_topic_content.

Topic Side TOC [webhelp_side_toc]

This component generates a mini table of contents for the current topic. It will contain links to the children of current topic, its siblings, and all of its ancestors. To generate this component, the webhelp_side_toc element must be specified in the template file. It can be used in the following type of template page:
In the template file, the webhelp_side_toc element can be specified as in the following example:
<whc:webhelp_side_toc 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_side_toc. This element will contain links to the topics that are close to the current topic.

Topic Feedback [webhelp_feedback]

This component generates a placeholder for where the comments section will be presented. To generate this component, the webhelp_feedback element must be specified in the template file. It can be used in the following type of template page:
In the template file, the webhelp_feedback element can be specified as in the following example:
<whc:webhelp_feedback 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

Main Page Topic Tiles [webhelp_tiles]

This component generates the tiles section in the main page. This section will contain a tile for each root topic of the published documentation. Each topic tile has three sections that corresponds to the topic title, short description, and image. To generate this component, the webhelp_tiles element must be specified in the template file. It can be used in the following type of template page:

In the template file, the webhelp_tiles element can be specified as in the following example:

<whc:webhelp_tiles 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_tiles.

If you want to control the HTML structure that is generated for a WebHelp tile you can also specify the template for a tile by using the whc:webhelp_tile component, as in the following example:

<whc:webhelp_tile class="col-md-4">                    
  <!-- Place holder for tile's image -->
  <whc:webhelp_tile_image/>                        
                    
  <div class="wh_tile_text">
    <!-- Place holder for tile's title -->
     <whc:webhelp_tile_title/>
                       
     <!-- Place holder for tile's shordesc -->
     <whc:webhelp_tile_shortdesc/>
  </div>
</whc:webhelp_tile>

For information about customizing the tiles, see Configuring the Tiles on the Main Page.

Main Page Table of Contents [webhelp_main_page_toc]

This component generates a simplified Table of Contents. It is simplified because it contains only two levels from the documentation hierarchy. To generate this component, the webhelp_main_page_toc element must be specified in the template file. It can be used in the following type of template page:

In the template file, the webhelp_main_page_toc element can be specified as in the following example:

<whc:webhelp_main_page_toc 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_main_page_toc.

Main Page Menu [webhelp_topics_menu]

This component generates a menu with all the documentation topics. To generate this component, the webhelp_topics_menu element must be specified in the template file. It can be used in the following type of template page:
In the template file, the webhelp_topics_menu element can be specified as in the following example:
<whc:webhelp_topics_menu 
     xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>

In the output, you will find an element with the class: wh_topics_menu.

You can control the maximum level of topics that will be included in the menu using the webhelp.top.menu.depth transformation parameter (in the Parameters tab of the transformation scenario.

For information about customizing the menu, see Customizing the Menu.

Include HTML files [webhelp_include_html]

This component can be used to include custom HTML files. To generate this component, the include_html element must be specified in the template file. It can be used in all four types of template pages:

In the template file, the include_html element can be specified as in the following example:

<whc:include_html href="${wh.param}"/>

Where the href can have the following values:

  • any URL - In this case, the file to be included is specified as an URL.
  • {$oxygen-webhelp-template-dir}/file_to_include.html - To include resources that are part of the template.
  • ${webhelp.param} - To include a resource whose path is specified through a WebHelp transformation scenario parameter. The value of this parameter can be a simple HTML fragment, in which case it will be copied to the output.

Link to Skin Resources [webhelp_skin_resources]

This component can be used to add a link to resources for the current WebHelp skin (such as the CSS file). To generate this component, the webhelp_skin_resources element must be specified in the template file. It can be used in all four types of template pages:

In the template file, the webhelp_skin_resources element can be specified as in the following example:

<whc:webhelp_skin_resources/>

In the output, you will find a link to the skin resources.