Yes here is the full contents of the panel #panelheader("Data Tools") #set ($hql = ", BaseObject as obj, LongProperty prop where obj.name=doc.fullName and obj.className='XWiki.ToolbarClass' and obj.name<>'XWiki.ToolbarClassTemplate' and obj.id=prop.id.id and prop.id.name='Order' order by prop.value") #set ($toolbars= $xwiki.searchDocuments($hql)) #if ($toolbars.size() > 0) #foreach ($toolbar in $toolbars) #set ($itemdoc = $xwiki.getDocument($toolbar)) #set ($itemobject = $itemdoc.getObject('XWiki.ToolbarClass')) #if($doc.fullName == $itemdoc.fullName ) #set ($imgsrc0 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #set ($imgsrc1 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #else #set ($imgsrc0 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('UpIcon')")) #set ($imgsrc1 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #end #set ($alttip = $itemdoc.display('Description')) #set ($panelft = $itemdoc.display('Panel')) #set ($imgref = "document." + $itemdoc.display('Title') + ".src") #if ( $panelft == 'DataTools') <SCRIPT TYPE="text/javascript" LANGUAGE="javascript"> <!-- function $itemdoc.display('Title')_up(imgtag) { imgtag.src="$imgsrc0"; } function $itemdoc.display('Title')_down(imgtag) { imgtag.src="$imgsrc1"; } //--> </SCRIPT> <div align="right"> [$itemdoc.display('Title')>$toolbar] /xwiki/bin/view/$itemdoc.display('GotoPage') $imgsrc0 </div> #end #end #else #info("There are no Toolbar documents in this wiki!") #end #panelfooter() Guillaume Lerouge wrote:
Hi Mike,
Hmmm, so why doesn't this work? I get results from the query, and build the
display. I want the panel where this resides to have an UpIcon and a DownIcon for all pages where the panel is displayed except when the panel is displayed on the current page where I want both the UpIcon and DownIcon the same as the DownIcon.
Currently the if statement always evaluates false.
#set ($hql = ", BaseObject as obj, LongProperty prop where obj.name=doc.fullName and obj.className='XWiki.ToolbarClass' and obj.name<>'XWiki.ToolbarClassTemplate' and obj.id=prop.id.id and prop.id.name='Order' order by prop.value") #set ($toolbars= $xwiki.searchDocuments($hql)) #if ($toolbars.size() > 0) #foreach ($toolbar in $toolbars) #set ($itemdoc = $xwiki.getDocument($toolbar)) #set ($itemobject = $itemdoc.getObject('XWiki.ToolbarClass')) #if($doc.fullName == $itemdoc.fullName ) #set ($imgsrc0 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #set ($imgsrc1 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #else #set ($imgsrc0 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('UpIcon')")) #set ($imgsrc1 = $xwiki.getAttachmentURL("$itemdoc","$itemdoc.display('DownIcon')")) #end ...
There's 2 #if and only 1 #end in your code, is it closed at a later stage ?
Guillaume _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://www.nabble.com/Panel-aware-of-page-tp17458341p17475639.html Sent from the XWiki- Users mailing list archive at Nabble.com.