Versions Compared

Key

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

Customized If you want to reuse customized stylesheets and javascript can not be passed to the templates without a files in several templates this is only doable by a dirty hack.

The hack

Create a new template. Do not add it to any to any Template Type Context.

...

Code Block
languagexml
linenumberstrue
## Obtain the template manager
#set($templateManager = $timeTrackingComponentManager.getTemplateManager())
#set($templateCss = $ $templateManager.getTemplateByKey("mycsstemplate"))
 
<style type="text/css">
	$!templateCss.getVelocityFileObject().getContentAsString()
</style>
 

 

You can do the same with JavaScript.

Or if you only need css or script in one template file, just add it directly to velocity template file.