Re: [xwiki-users] How to get the document name WITH spaces
Yes I know this already but for example if u want to create a new page called World cup The page will be called worldcup if u do a [$doc.name] Here the name of the link will be normal "World Cup" BUT if u do a $doc.name u will get worldcup. My problem is i want to get the normal name of the page which is displayed when u do a [$doc.name] Thanks Original Message: Hi, <br /> <br />On Fri, Jul 25, 2008 at 10:42 AM, Hosam Hassan wrote: <br />> Hello Guys, <br />> <br />> I want to get the document name but WITH the spaces. I do it like that $doc.name but it prune the white spaces for some reason!. Any idea how to get the normal name of the document?. <br /> <br />$doc.space = Space <br />$doc.name = PageName <br />$doc.fullName = Space.PageName <br />$doc.prefixedFullName = wikiname:Space.PageName <br /> <br />See XWiki api for a complete list of available methods : <br />http://platform.xwiki.org/xwiki/bin/view/DevGuide/API <br /> <br />> <br />> Many thanks, <br />> <br />> Hosam <br />> _______________________________________________ <br />> users mailing list <br />> [email protected] <br />> http://lists.xwiki.org/mailman/listinfo/users <br />> <br />> <br /> <br /> <br /> <br />-- <br />Thomas Mortagne <br />_______________________________________________ <br />users mailing list <br />[email protected] <br />http://lists.xwiki.org/mailman/listinfo/users <br /> --
On Fri, Jul 25, 2008 at 2:52 PM, Hosam Hassan <[email protected]> wrote:
Yes I know this already but for example if u want to create a new page called
World cup
The page will be called worldcup
if u do a [$doc.name] Here the name of the link will be normal "World Cup"
BUT if u do a $doc.name u will get worldcup.
OK sorry I mixed space of wiki page and " " character ;) $doc.name should return you the correct name, otherwise it's a bug. What XWiki Core/XE version do you use ?
My problem is i want to get the normal name of the page which is displayed when u do a [$doc.name]
Thanks
Original Message:
Hi, <br /> <br />On Fri, Jul 25, 2008 at 10:42 AM, Hosam Hassan wrote: <br />> Hello Guys, <br />> <br />> I want to get the document name but WITH the spaces. I do it like that $doc.name but it prune the white spaces for some reason!. Any idea how to get the normal name of the document?. <br /> <br />$doc.space = Space <br />$doc.name = PageName <br />$doc.fullName = Space.PageName <br />$doc.prefixedFullName = wikiname:Space.PageName <br /> <br />See XWiki api for a complete list of available methods : <br />http://platform.xwiki.org/xwiki/bin/view/DevGuide/API <br /> <br />> <br />> Many thanks, <br />> <br />> Hosam <br />> _______________________________________________ <br />> users mailing list <br />> [email protected] <br />> http://lists.xwiki.org/mailman/listinfo/users <br />> <br />> <br /> <br /> <br /> <br />-- <br />Thomas Mortagne <br />_______________________________________________ <br />users mailing list <br />[email protected] <br />http://lists.xwiki.org/mailman/listinfo/users <br />
--
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
What we need (do we have it already?) is an API to render a camel case name with spaces. I was looking for one some months ago. I think this would be useful. I need it for example for the level 1 titles on xwiki.org -Vincent On Jul 25, 2008, at 2:52 PM, Hosam Hassan wrote:
Yes I know this already but for example if u want to create a new page called
World cup
The page will be called worldcup
if u do a [$doc.name] Here the name of the link will be normal "World Cup"
BUT if u do a $doc.name u will get worldcup.
My problem is i want to get the normal name of the page which is displayed when u do a [$doc.name]
Thanks
Original Message:
Hi, <br /> <br />On Fri, Jul 25, 2008 at 10:42 AM, Hosam Hassan wrote: <br />> Hello Guys, <br />> <br />> I want to get the document name but WITH the spaces. I do it like that $doc.name but it prune the white spaces for some reason!. Any idea how to get the normal name of the document?. <br /> <br />$doc.space = Space <br />$doc.name = PageName <br />$doc.fullName = Space.PageName <br />$doc.prefixedFullName = wikiname:Space.PageName <br /> <br />See XWiki api for a complete list of available methods : <br />http://platform.xwiki.org/xwiki/bin/view/DevGuide/API <br /> <br />> <br />> Many thanks, <br />> <br />> Hosam <br />> _____________
Hosam Hassan wrote:
Yes I know this already but for example if u want to create a new page called
World cup
The page will be called worldcup
if u do a [$doc.name] Here the name of the link will be normal "World Cup"
BUT if u do a $doc.name u will get worldcup.
My problem is i want to get the normal name of the page which is displayed when u do a [$doc.name]
That is not the document name, but the document title. You can get it with $doc.displayTitle If you want to camelcase the document name, you can use: $doc.name.replaceAll('([a-z])([A-Z])', '$1 $2') -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (4)
-
Hosam Hassan -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol