The next step is to create the actual help page. The help page is
a normal VelocityContainer page that is used by
the ContextHelpPageCrumbController to display the
help page. Thus, you can use everything you can use in a normal
OLAT-Core velocity page.
The context help page must be stored in the directory
_chelp under the name used in the launcher icon. In
the example above, the help page would be located under
CLASSPATH/org/olat/group/ui/edit/_chelp/grp-BuddyGroup-des.html.
Mostly you will use the translator to display the translatable elements on the screen. It is a good idea to split your help page into some paragraphs and use meaningfull i18n keys.
By convention, all i18n keys that are used for a context help
should have the chelp. prefix:
chelp.grouphelp.intro,
chelp.grouphelp.accessrights ... Since the
context help page is in the same Java package as the code where the help
page is embedded, you have full access to all other i18n keys from your
package. So you can refer to elements from your actual GUI very easily.
There are also other methods you can use
Translations:
## Normal translation
## Example without and with arguments
##
$r.translate("chelp.grouphelp.intro") $r.translate("another.key.that.already.exists")
$r.translate("chelp.grouphelp.intro", ["hello", "world"])
## Translation that uses key from another package
## Example without and with arguments
##
$r.translateWithPackage("org.olat.core", "cancel")
$r.translateWithPackage("org.olat.core", "cancel", ["hello", "world"])
Links to other context help pages:
## Link to another context help page in another bundle with my custom link text ## $r.contextHelpRelativeLink(String bundleName, String pageName, String linkText) ## Link to another context help page in another bundle with the page title as link text ## $r.contextHelpRelativeLink(String bundleName, String pageName) ## Link to another context help page the same bundle ## $r.contextHelpRelativeLink(String pageName)
It is also possible to use images and other static files in the
context help. These files must be located in the _static directory of
the context help directory. In our example an image would be located
here:
CLASSPATH/org/olat/group/ui/edit/_chelp/_static/myimage_de_CH.png
Note that the image must also contain the locale postfix. There must be an image for at least the fallback language en. If your image is localized, add an image for each language.
Using the image is easy since the context help system adds a special variable to velocity that gives you the path to the image folder. Note, the image name used in the velocity file is without the language code since this page is the same for each language! The system automatically checks if the image is available for the currently used locale and uses the fallbackchain to find the fallback image.
## Embedd an image. Or create a PDF download. Or add a movie... ## <img src="$chelpStaticDirUrl/myimage.png" />