| Title | Wiki Tag For Current Template Absolute Path |
| Date | 01-Sep-2005 19:51:50 EEST |
| JSPWiki version | |
| Submitter | GregorHagedorn |
| Idea Category | TemplateIdea |
| Reference | |
| Idea Status | NewIdea |
Refactored from Ideas page:
Add a wiki tag to get the current template absolute path
This is useful when you define a custom template, for example to simply get the absolute path to template files (such as images)
package com.ecyrd.jspwiki.tags;
public class TemplatePathTag extends WikiTagBase {
public final int doWikiStartTag() throws IOException {
String templatePath = m_wikiContext.getHttpRequest().getContextPath() + "/templates/" + m_wikiContext.getTemplate();
pageContext.getOut().print(templatePath);
return SKIP_BODY;
}
}
-- Mar 24, 2005 -- LaurentMorin