Last modified by Vincent Massol on 2023/10/10

<
From version < 19.4 >
edited by Vincent Massol
on 2017/09/05
To version < 20.1 >
edited by Marius Dumitru Florea
on 2017/11/27
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.mflorea
Content
... ... @@ -171,12 +171,15 @@
171 171  We can improve the display of our "External Image" properties by creating a custom displayer. One way to achieve this is by creating a Velocity template ##displayer_externalimage.vm## under the ##/templates/## folder.
172 172  
173 173  {{code language="none"}}
174 -#if ($type == 'edit')
175 - #set($id = $escapetool.xml("${prefix}${name}"))
174 +#if ($type == 'edit' || $type == 'search')
175 + #set ($id = $escapetool.xml("${prefix}${name}"))
176 176   <input type="text" id="$!id" name="$!id" value="$!escapetool.xml($value)" />
177 -#elseif ($type == 'view')
177 +#elseif ($type == 'view' || $type == 'rendered')
178 178   <img src="$escapetool.xml($value)" alt="$escapetool.xml($field.getProperty('placeholder').value)"
179 179   class="$escapetool.xml($field.getProperty('styleName').value)" />
180 +#elseif ($type == 'hidden')
181 + #set ($id = $escapetool.xml("${prefix}${name}"))
182 + <input type="hidden" id="$!id" name="$!id" value="$!escapetool.xml($value)" />
180 180  #else
181 181   ## In order for the custom displayer to be taken into account, the result of its evaluation with an unknown display
182 182   ## mode must not be empty. Let's output something.

Get Connected