Hi Wouter,

On Mon, May 10, 2010 at 22:23, Wouter Boasson <[email protected]>wrote:

> Hi,
>
> I discovered that, although special characters in url's are usually
> encoded, there's still a problem with the breadcrumbs. Also, when trying to
> create a new page in the colibri skin, when you're on a page/in a space with
> an & in the name, and maybe other characters too, the create page function
> simply does not work.
>
> As the documents name in the url and the title are properly separated, I
> decided to improve the stability by always cleaning-up document and
> space-names. This includes removing the option to create a space by
> specifying a pagename with a dot or slash in it. This will lead to
> unexpected and unwanted results, at least in my environment.
>
> In file: templates/create.vm
>
> (Pages) Replace:
> #set($docname=$title.replaceAll("/", "."))
> By:
> #set($docname=$title.replaceAll("[\=\&\@'\\/()]",
> "-").replaceAll('"',"").replaceAll("[^a-zA-Z0-9-_~]","_"))
>
> (Spaces) Replace:
> #set($title=$title.replaceAll(" \\.\\/", ""))
> By:
> #set($docname=$title.replaceAll(" \\.\\/", "").replaceAll("[\=\&\@'\\/()]",
> "-").replaceAll('"',"").replaceAll("[^a-zA-Z0-9-_~]","_"))
>
> XWiki 2.2.4/XE (if something like this was already done, excuse for the
> noise in the mailing list).
>

That's nice! You should look on http://code.xwiki.org/ , notably in the
"code snippets" section, to see whether other people have already done this.

You could add your own snippets there too :-)

Guillaume


> Regards,
> Wouter
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to