It appears that Xwiki allows the use of special characters in page titles, e.g. I can create a page with title
‘foo | bar’ or ‘foo / bar’. However, since the page title also forms the URL for the page access, some characters may create trouble later on and makes it difficult or even impossible to access the page.
Is there a way to restrict the use of such characters for a page title, or modify the method how a page title forms the URL?
If you really really need to change that (we don’t recommend it since that will make your future upgrades harder), you could modify create_inline.vm (or override it in a custom skin) or the CreateAction.java class. But it’s not easy and I don’t know the exact places you’d need to modify (you’ll need to understand the code there).
I have a similar problem (xwiki 12.10.3) . Someone has created a page called “Tools / Stuff”. The page is in the left nav menu. I cannot navigate to the page, when I click the left nav menu item it says the page does not exist.
I tied the script mentioned above. I dont understand the text in the script “Fill in the name of the space of the page (all path to the page separated by dot). For nested pages, this needs to be the full name of the page, and the pagename (under) will be WebHome.” The page is at the top level so I put WebHome; is that what it means?
When I previewed delete it says the page does not exist. How can I delete the page and or remove the link from the left nav menu?
Thanks
PS: We don’t support old versions of XWiki on this forum. We recommend that you upgrade to XWiki 14.10.x which is supported and contains a lof fixes, improvements and security issues fixed since 12.10.x.
This document checks if there are wiki pages with "/" in their names. These cannot be edited in the normal way.
This allows the renaming of such documents.
{{velocity}}
#if ("$!request.listenElement" != "")
#set($parList = $request.getParameterValues('listenElement'))
selected are:
#foreach($number in $parList)
#set ($pageReference=$request.getParameterValues("original_$number")[0])
#set ($newPageReference=$request.getParameterValues("neu_$number")[0])
* $pageReference
* $newPageReference
#set ($discard=$xwiki.getDocument($pageReference).rename($newPageReference))
----
#end
##
#else
##
## get document list
##
{{html wiki="true"}}
#set($pagesWithSlash = $xwiki.searchDocuments("where doc.fullName like '%/%' or doc.name like '%\\%'"))
<form action="" method="post">
<small> <dl>
#if ($pagesWithSlash.size()==0)
{{info}}**No problem documents found.**{{/info}}
#else
Please correct the name and mark the elements to be changed
(% style="color:red" %)
Attention: The name must be a full name (containg the spaces) otherwise new spaces are generated.(%%)
#foreach ($x in $pagesWithSlash)
#set ($value="$velocityCount")
<dt> $velocityCount : <input type="checkbox" name="listenElement" value="$value"></input>
<input name="original_$velocityCount" value="$x" style="visibility:hidden" size="0"></input> </dt>
<dd>$x<br/>
#set ($size=$x.length()+30)
<input name="neu_$velocityCount" value="$x" size="$size"></input>
</dd>
#end
<hr>
<input style="left-margin:260px" type="submit" class="button" value="change marked documents" />
</dl>
</small>
</form>
{{/html}}
#end
#end
{{/velocity}}
You get a list of documents with “/” in their name and rename them.
That’s because the problem is not really how pages have been created but simply the fact that, by default, Tomcat refuse to access a page with a / or \ in its name.