Ok first problem solved the img link had the arguments in the wrong order so
<<mg
src="$xwiki.getAttachmentURL("AEBtn0.jpg","Toolbar.AdvancedEditorButton")"
/> was bad and
<<mg
src="$xwiki.getAttachmentURL("Toolbar.AdvancedEditorButton","AEBtn0.jpg")"
/> was good.
Now the question is, given the desire to show in the dashboard now and
eventually in a panel later the icons named in the properties of the toolbar
classes, how do I loop through the toolbars and build the displa from the
properties?
Mike Oliver wrote:
I am making good progress on a new Class that has properties, style sheet
and template that I created after following the Todo Tutorial.
The ToolbarClass has the following properties
Type/Name/SampleContent
String/Title/Advanced Editor
TextArea/Description/This button takes you to the advanced editor page
String/UpIcon/AEBtn0.jpg
String/DownIcon/AEBtn1.jpg
String/DisabledIcon/AEBtn2.jpg
String/GotoPage/Tools.AdvancedEditor
Also following the Todo Tutorial I created the Toolbar Space Web Home page
dashboard with
#set ($hql = ", BaseObject as obj where obj.name=doc.fullName
and obj.className='XWiki.ToolbarClass' and
obj.name<>'XWiki.ToolbarClassTemplate'")
#set ($toolbars= $xwiki.searchDocuments($hql))
#if ($toolbars.size() > 0)
#foreach ($toolbar in $toolbars)
* [$toolbar]
#end
#else
#info("There are no Toolbar documents in this wiki!")
#end
And I added the Comments object to the ToolbarClassTemplate
and then added a couple of document and attached the UPIcon and DownIcon
images as attachments.
Going to the Web Home of the I see the list of the two document with the
ToolbarClass object on them so cool beans just as the tutorial instructed
with the names changed and bingo we have a winner.
Now the tricky part, I want to show the attached images in the dashboard
for each document, where the property of the Toolbar object for UpIcon is
used to identifiy which attachment to display.
I tried
#set ($hql = ", BaseObject as obj where obj.name=doc.fullName
and obj.className='XWiki.ToolbarClass' and
obj.name<>'XWiki.ToolbarClassTemplate'")
#set ($toolbars= $xwiki.searchDocuments($hql))
#if ($toolbars.size() > 0)
#foreach ($toolbar in $toolbars)
* <<mg
src="$xwiki.getAttachmentURL("AEBtn0.jpg","Toolbar.AdvancedEditorButton")"
/> [$toolbar]
#end
#else
#info("There are no Toolbar documents in this wiki!")
#end
where I know that AEBtn0.jpg is the attached image but that doesn't show.
Eventually I want to use the string in the UpIcon property to identify the
image to display but unless I can get the attachement to display on
another page I cannot proceed.
--
View this message in context:
http://www.nabble.com/Creating-a-Toolbar-of-my-own-tp17410485p17410953.html
Sent from the XWiki- Users mailing list archive at
Nabble.com.