Wiki Headers

From Fxp Wiki

Jump to: navigation, search



!AuthorCib (19.10.2003) Ideas -- insert header (javascript and meta) On a very limited number of pages, I need to insert script in header, or a special meta tag. I've added a little snippet in the head of viewtemplate.jsp, but I'm sure there are betters ways. If someone had an idea ?

The headers are not wiki pages: they are stored in template directory.

<% String pagereq2 = ((com.ecyrd.jspwiki.WikiContext)pageContext.getAttribute

 ("jspwiki.context", PageContext.REQUEST_SCOPE)).getPage().getName(); 

String pagereqHead = pagereq2 + "_head.jsp"; java.io.File file = new java.io.File(application.getRealPath

 ("templates/default/" + pagereqHead));

out.print(file.getPath()); if( file.exists()) {

   %>
        

<%

   }

else {} %>

The headers are wiki page, editable and addable by visitors:

<% String pagereq2 = ((com.ecyrd.jspwiki.WikiContext)pageContext.getAttribute ("jspwiki.context", PageContext.REQUEST_SCOPE)).getPage().getName(); String pagereqHead = pagereq2 + "Head"; %> ATTENTION: you need to escape square brackets in your javascript by double opening bracket document.form[[[2]].option







Views
Personal tools
Menu:
Navigation
Toolbox