Kevin_C wrote:
> I am using this query:
> 
> #set($hql = ", BaseObject as obj where obj.name=doc.fullName and
> obj.className='Space1.MyClass' and
> obj.name<>'${doc.space}.${class}ClassTemplate' and doc.space='MySpace'")
> 
> to return a list of documents from a different space and I am trying to now
> create a view link to the document. I have tried several combinations using
> getUrl() but nothing seems to work. Here's some of the code I've tried:
> 
>   <ol>
>   #foreach($faq in $recentlyCreated)
>     #set($doc = $xwiki.getDocument('FranchiseTax', $faq))

Think about using a different name for this variable as $doc is the name of the 
default context variable which holds the current document. Use, for example, 
$faqDoc.

#set($faqDoc = $xwiki.getDocument('FranchiseTax', $faq))

>     <li>[$doc.question>$doc.getUrl("view")]</li>

<li>[$faqDoc.question > $faqDoc.fullName]</li>

should do it at this point, as [] marks a wikilink and Space.Page (which is 
exactly what fullName is) is a reference to the desired document.

Happy coding,
Anca Luca


>   #end
>   </ol>
> 
> What am I missing?
> 
> 
> Thanks in Advance!
> .:. Kevin
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to