[xwiki-users] Page (or db list) & view link
Hi everyone, I'm just starting with xWiki and there is something I'm having a hard time to achieve. Having a page property (db list) for a class, I want to see the wikilink to the selected document when in view mode, instead of just the text value of the fullName that was selected. I wrote a query that lets me select from pages, I know I need to edit either my class sheet or my property custom display, but I can't figure it out. I read things here and there. The most helpful were these: http://www.xwiki.org/xwiki/bin/view/FAQ/HowToCreateAOneToManyRelationshipInX... <http://www.xwiki.org/xwiki/bin/view/FAQ/HowToCreateAOneToManyRelationshipInXWiki> http://www.xwiki.org/xwiki/bin/view/FAQ/Which+variables+I+can+use+in+%22Cust... <http://www.xwiki.org/xwiki/bin/view/FAQ/Which+variables+I+can+use+in+%22Custom+Display%22+field> http://extensions.xwiki.org/xwiki/bin/view/Extension/List+All+Documents+In+A... <http://extensions.xwiki.org/xwiki/bin/view/Extension/List+All+Documents+In+A+Space> I can't believe I'm the only one needing this / struggling with this. Thanks for your help! -- View this message in context: http://xwiki.475771.n2.nabble.com/Page-or-db-list-view-link-tp7595252.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, If I understand correctly, you have a list property ("a") of a class ("Main.TestClass") that stores page names ("Main.SomePage") and you want to display the value of that property in a sheet such that each page name is rendered as a wiki link ("[[Main.SomePage]]"). Here you go: {{velocity}} #set ($object = $doc.getObject("Main.TestClass")) #set ($values = $object.getValue("a")) #foreach ($value in $values) [[$value]] #end {{/velocity}} Depending on your usecase, you might want to display the document title as label for the wiki link instead of the page name, so you would have to do something like... ... #foreach ($value in $values) #set ($document = $xwiki.getDocument($value)) [[$document.plainTitle>>$value]] #end ... Hope this helps, Eduard On Tue, Jun 23, 2015 at 9:58 AM, bobino <[email protected]> wrote:
Hi everyone, I'm just starting with xWiki and there is something I'm having a hard time to achieve. Having a page property (db list) for a class, I want to see the wikilink to the selected document when in view mode, instead of just the text value of the fullName that was selected.
I wrote a query that lets me select from pages, I know I need to edit either my class sheet or my property custom display, but I can't figure it out. I read things here and there. The most helpful were these:
http://www.xwiki.org/xwiki/bin/view/FAQ/HowToCreateAOneToManyRelationshipInX... < http://www.xwiki.org/xwiki/bin/view/FAQ/HowToCreateAOneToManyRelationshipInX...
http://www.xwiki.org/xwiki/bin/view/FAQ/Which+variables+I+can+use+in+%22Cust... < http://www.xwiki.org/xwiki/bin/view/FAQ/Which+variables+I+can+use+in+%22Cust...
http://extensions.xwiki.org/xwiki/bin/view/Extension/List+All+Documents+In+A... < http://extensions.xwiki.org/xwiki/bin/view/Extension/List+All+Documents+In+A...
I can't believe I'm the only one needing this / struggling with this.
Thanks for your help!
-- View this message in context: http://xwiki.475771.n2.nabble.com/Page-or-db-list-view-link-tp7595252.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
bobino -
Eduard Moraru