[xwiki-users] How to assess what page is currently being viewed by the user
Hello community, This may be a bit of an easy/stupid question, but bear with me! Is there a way to assess what page is currently being viewed by the user (with Velocity), so that I may be able to do something like this: #if (currentPage = someOtherPage) ...do this... #else ... do something else... #end Any input on this would be amazing! Cheers once again to the XWiki community. -- View this message in context: http://n2.nabble.com/How-to-assess-what-page-is-currently-being-viewed-by-th... Sent from the XWiki- Users mailing list archive at Nabble.com.
BrianJones wrote:
Hello community,
This may be a bit of an easy/stupid question, but bear with me! Is there a way to assess what page is currently being viewed by the user (with Velocity), so that I may be able to do something like this:
#if (currentPage = someOtherPage) ...do this... #else ... do something else... #end
Any input on this would be amazing! Cheers once again to the XWiki community.
$doc is the current document, an instance of com.xpn.xwiki.api.Document, see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi... So, to get the name, just use: #if($doc.fullName == 'Some.Document') -- Sergiu Dumitriu http://purl.org/net/sergiu/
Thanks Sergiu! Sergiu Dumitriu-2 wrote:
$doc is the current document, an instance of com.xpn.xwiki.api.Document, see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi...
So, to get the name, just use:
#if($doc.fullName == 'Some.Document')
-- View this message in context: http://n2.nabble.com/How-to-assess-what-page-is-currently-being-viewed-by-th... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
BrianJones -
Sergiu Dumitriu