You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Dave Koelmeyer <da...@davekoelmeyer.co.nz> on 2012/09/16 09:15:11 UTC

Default content in new wiki pages

Hi All,

In what file do I define default content for new wiki pages?

For example, if I want to insert a table of contents in every new page 
by including "[{TableOfContents numbered='yes'}]" etc. where would this 
be set?

Thanks for any pointers :)

-- 
Dave Koelmeyer
http://www.davekoelmeyer.co.nz


Re: Default content in new wiki pages

Posted by Dave Koelmeyer <da...@davekoelmeyer.co.nz>.
Hi Juan Pablo,

Thanks for that information - very helpful :)

Cheers,
Dave

On Mon, Sep 17, 2012 at 10:26 AM, Juan Pablo Santos Rodríguez <
juanpablo.santos@gmail.com> wrote:

> Hi Dave,
>
> there isn't a switch to insert custom content, so you'd have to modify
> JSPWiki source. You can play with usertext variable at
> $SVN_TRUNK/src/webdocs/templates/default/editors/plain.jsp (definition at
> line 27), adding something like:
>
> <wiki:NoSuchPage>
>   usertext = "DEFAULT_INIT_CONTENT"
> </wiki:NoSuchPage>
> near line 60 or just reuse the block in lines 30 - 51, for example.
>
> If you want to enforce the initial content no matter what is inserted, then
> the way to go could be a custom PageFilter. Take a look at the
> $SVN_TRUNK/org/apache/wiki/filters/ProfanityFilter for an example.
>
>
> HTH,
> juan pablo
>
>
> On Sun, Sep 16, 2012 at 9:15 AM, Dave Koelmeyer <
> dave.koelmeyer@davekoelmeyer.co.nz> wrote:
>
> > Hi All,
> >
> > In what file do I define default content for new wiki pages?
> >
> > For example, if I want to insert a table of contents in every new page by
> > including "[{TableOfContents numbered='yes'}]" etc. where would this be
> set?
> >
> > Thanks for any pointers :)
> >
>

Re: Default content in new wiki pages

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi Dave,

there isn't a switch to insert custom content, so you'd have to modify
JSPWiki source. You can play with usertext variable at
$SVN_TRUNK/src/webdocs/templates/default/editors/plain.jsp (definition at
line 27), adding something like:

<wiki:NoSuchPage>
  usertext = "DEFAULT_INIT_CONTENT"
</wiki:NoSuchPage>
near line 60 or just reuse the block in lines 30 - 51, for example.

If you want to enforce the initial content no matter what is inserted, then
the way to go could be a custom PageFilter. Take a look at the
$SVN_TRUNK/org/apache/wiki/filters/ProfanityFilter for an example.


HTH,
juan pablo


On Sun, Sep 16, 2012 at 9:15 AM, Dave Koelmeyer <
dave.koelmeyer@davekoelmeyer.co.nz> wrote:

> Hi All,
>
> In what file do I define default content for new wiki pages?
>
> For example, if I want to insert a table of contents in every new page by
> including "[{TableOfContents numbered='yes'}]" etc. where would this be set?
>
> Thanks for any pointers :)
>
> --
> Dave Koelmeyer
> http://www.davekoelmeyer.co.nz
>
>