wwHelp::SetTemplate

This method allows you to specify a template for use by the next call to RenderTopic. You can specify a template either by:

  • Using a fully qualified path
  • Only a filename
  • Not passing any parameters at all

wwHelp::SetTemplate(cTemplate)

Return Value

nothing

Parameters

cTemplate
Can be a full path to a WCS template file or just the file name

Remarks

SetTemplate works through the template hierarchy. If you pass a full path that template is used if found. If not found it falls through to no template passed at all. If only a filename is passed Help Builder looks for the file first in the project's TEMPLATES directory, then in the Help Builder TEMPLATES directory.

If no template is passed at all Help Builder uses the following logic to find a template:

  • Template by the name of the current type (HEADER, TOPIC, CLASSHEADER etc) with a WCS extension in the project's TEMPLATES directory

  • Same template name in the Help Builder's TEMPLATES directory

  • wwHelp.wcs in the project's TEMPLATES directory

  • wwHelp.wcs in Help Builder's TEMPLATES directory

As you can see you can customize templates for each topic type and rely on the default templates provided or override them with your own templates for each project or for every project by overriding the original templates (always make backups if you change the original templates in Help Builder's TEMPLATES directory).

Example

o=CREATE("wwHelp.wwhelp")
o.Open("c:\temp\wchelp\wchelp.hbp",.t.)
o.LoadTopic("Class wwServer",1)

*** Load the default template for this topic
o.SetTemplate()

*** Optionally assign a template to use for rendering
*** The default is the project's TEMPLATE path wwHelp.wcs
* o.SetTemplate("c:\temp\myhelp\myhelp\classheaderCustom.wcs")

*** Display the topic
?  o.RenderTopic()   && ShowHTML( o.RenderTopic() )

Overloads:


See also:

Class wwHelp

© West Wind Techologies, 1996-2023 • Updated: 04/13/05
Comment or report problem with topic