[xwiki-devs] Using an image in a skin in a [[link]]
Hi guys, I'm trying to write some groovy that uses an image thats in the current skin in a link. In this case its a delete page image, that links to a delete page URL: [[image:${xwiki.getSkinFile('icons/silk/page_delete.gif')}>>${doc.getExternalURL('delete')}]] The issue is that the getSkinFile call returns a relative URL, which ends up getting rendered in the final HTML as <img alt="/xwiki/resources/icons/silk/page_delete.gif" class="wikimodel-freestanding" src="/xwiki/bin/download/Storyboard/fcg9aYKeaI6AVIjxpocO/%2Fxwiki%2Fresources%2Ficons%2Fsilk%2Fpage_delete.gif"></img> Do you have any suggestions for how I can get access to one of the icons for use as an image for a URL? Thanks, Nigel
Hi Nigel, On Nov 10, 2011, at 6:49 AM, Nigel Smith wrote:
Hi guys,
I'm trying to write some groovy that uses an image thats in the current skin in a link. In this case its a delete page image, that links to a delete page URL:
[[image:${xwiki.getSkinFile('icons/silk/page_delete.gif')}>>${doc.getExternalURL('delete')}]]
See http://www.xwiki.org/xwiki/bin/view/FAQ/How+to+display+an+Icon+from+the+XWik... Thanks -Vincent
The issue is that the getSkinFile call returns a relative URL, which ends up getting rendered in the final HTML as
<img alt="/xwiki/resources/icons/silk/page_delete.gif" class="wikimodel-freestanding" src="/xwiki/bin/download/Storyboard/fcg9aYKeaI6AVIjxpocO/%2Fxwiki%2Fresources%2Ficons%2Fsilk%2Fpage_delete.gif"></img>
Do you have any suggestions for how I can get access to one of the icons for use as an image for a URL?
Thanks, Nigel
participants (2)
-
Nigel Smith -
Vincent Massol