Wiki-Quellcode von Titel

Zuletzt geändert von Daniel Herrmann am 2025/07/19 16:57

Zeige letzte Bearbeiter
1 {{velocity}}
2 #if ($type == 'edit')
3 #set ($className = $object.getxWikiClass().name)
4 #set ($id = $escapetool.xml("${prefix}${name}"))
5 #if ($doc.fullName == $className)
6 ## We are editing the class so the title must be read from / written to the template document.
7 #set ($name = 'templateTitle')
8 #set ($value = $xwiki.getDocument("$stringtool.removeEnd($className, 'Class')Template").title)
9 #else
10 ## We are editing an application entry so the title must be read from / written to the current document.
11 #set ($name = 'title')
12 #set ($value = $tdoc.title)
13 #if ("$!value" == '')
14 #set ($value = $tdoc.documentReference.name)
15 #end
16 #end
17 {{html clean="false"}}
18 <input id="$id" type="text" name="$name" value="$!escapetool.xml($value)"
19 ## The default value for an AppWithinMinutes field should be optional so we make only the actual page title
20 ## mandatory and not the template title, which holds the default title value.
21 #if ($name == 'title' && $xwiki.getSpacePreference('xwiki.title.mandatory') == 1)required #end
22 data-validation-value-missing="$escapetool.xml($services.localization.render('core.validation.required.message'))"/>
23 {{/html}}
24 #elseif ("$!type" != '')
25 ## Render the title of the current document.
26 {{html}}$tdoc.getRenderedTitle('xhtml/1.0'){{/html}}
27 #else
28 The display mode is not specified!
29 #end
30 {{/velocity}}