# Wiki source code of Templates

Last modified by Alexandru Colesnicov on 2019/07/24 16:43
Export
Office Formats
Export as PDF
Other Formats

Select the pages to export:

select all / none

Export as HTML

Hide last authors

author | version | line-number | content
--- | --- | --- | ---
| 1.1 | 1 | {{include reference="Help.Code.VelocityMacros" /}}
|  | 2 |
|  | 3 | {{velocity output="false"}}
|  | 4 | #set ($actionCards = [{
| 3.1 | 5 | 'title': $services.localization.render('help.templates.useTemplates.title'),
|  | 6 | 'description': $services.localization.render('help.templates.useTemplates.description'),
|  | 7 | 'tip': $services.localization.render('help.templates.useTemplates.tip', ["<a href='http://platform.xwiki.org/xwiki/bin/view/Features/DocumentLifecycle#HCreate' class='wikiexternallink'>",'</a>']),
| 1.1 | 8 | 'thumbnail': 'Template',
|  | 9 | 'actions': [{
| 3.1 | 10 | 'label': $services.localization.render('help.try.label'),
| 1.1 | 11 | 'type': 'success',
|  | 12 | 'url': $xwiki.getURL('Sandbox.WebHome', 'create', $escapetool.url({
|  | 13 | 'title': "New Page $datetool.get('dd MMM yyyy, HH:mm')"
|  | 14 | }))
|  | 15 | }]
|  | 16 | }, {
| 3.1 | 17 | 'title': $services.localization.render('help.templates.create.title'),
|  | 18 | 'description': $services.localization.render('help.templates.create.description'),
|  | 19 | 'tip': $services.localization.render('help.templates.create.tip', ["<a href='http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application#HCreatetheTemplateProvider' class='wikiexternallink'>",'</a>']),
| 1.1 | 20 | 'thumbnail': 'Administration',
|  | 21 | 'actions': [{
| 3.1 | 22 | 'label': $services.localization.render('help.more.label'),
| 1.1 | 23 | 'url': 'http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application#HCreatetheTemplateProvider'
|  | 24 | }]
|  | 25 | }])
|  | 26 |
|  | 27 | #if ($hasAdmin)
|  | 28 | #set ($discard = $actionCards[1].actions.add(0, {
| 3.1 | 29 | 'label': $services.localization.render('help.browse.label'),
| 1.1 | 30 | 'url': $xwiki.getURL('XWiki.XWikiPreferences', 'admin', 'editor=globaladmin&section=Templates')
|  | 31 | }))
|  | 32 | #end
|  | 33 |
| 2.1 | 34 | #macro (getTemplateExample $inputCard $outputCard)
|  | 35 | #set ($templateReference = $services.model.resolveDocument($inputCard.templateReference))
|  | 36 | #if ($xwiki.getDocument($templateReference).isNew())
|  | 37 | #set ($outputCard = {
|  | 38 | 'title': $inputCard.title,
|  | 39 | 'description': $inputCard.description,
|  | 40 | 'documentation': 'http://extensions.xwiki.org/xwiki/bin/view/Extension/Templates+Application/',
|  | 41 | 'thumbnail': $inputCard.thumbnail
|  | 42 | })
|  | 43 | #else
|  | 44 | #set ($outputCard = {
|  | 45 | 'title': $inputCard.title,
|  | 46 | 'description': $inputCard.description,
|  | 47 | 'examples': $inputCard.templateReference,
|  | 48 | 'thumbnail': $inputCard.thumbnail
|  | 49 | })
|  | 50 | #end
|  | 51 | #end
|  | 52 |
| 1.1 | 53 | #set ($exampleCards = [{
| 3.1 | 54 | 'title': $services.localization.render('help.templates.article.title'),
|  | 55 | 'description':$services.localization.render('help.templates.article.description'),
| 2.1 | 56 | 'templateReference': 'Templates.Article.Template.WebHome',
|  | 57 | 'thumbnail': 'Help.Templates.WebHome@article.png'
| 1.1 | 58 | }, {
| 3.1 | 59 | 'title': $services.localization.render('help.templates.encyclopedia.title'),
|  | 60 | 'description': $services.localization.render('help.templates.encyclopedia.description'),
| 2.1 | 61 | 'templateReference': 'Templates.Encyclopedia.Template.WebHome',
|  | 62 | 'thumbnail': 'Help.Templates.WebHome@encyclopedia.png'
| 1.1 | 63 | }, {
| 3.1 | 64 | 'title': $services.localization.render('help.templates.meeting.title'),
|  | 65 | 'description': $services.localization.render('help.templates.meeting.description'),
| 2.1 | 66 | 'templateReference': 'Templates.Meeting.Template.WebHome',
|  | 67 | 'thumbnail': 'Help.Templates.WebHome@meeting.png'
| 1.1 | 68 | }, {
| 3.1 | 69 | 'title': $services.localization.render('help.templates.simple.title'),
|  | 70 | 'description': $services.localization.render('help.templates.simple.description'),
| 2.1 | 71 | 'templateReference': 'Templates.SimplePage.Template.WebHome',
|  | 72 | 'thumbnail': 'Help.Templates.WebHome@simple.png'
| 1.1 | 73 | }])
|  | 74 | {{/velocity}}
|  | 75 |
|  | 76 | {{velocity}}
|  | 77 | {{html clean="false"}}
|  | 78 | <div class="row">
|  | 79 | #foreach ($card in $actionCards)
|  | 80 | ## See http://getbootstrap.com/css/#grid-responsive-resets .
|  | 81 | #if ($foreach.index > 0 && $foreach.index % 2 == 0)
|  | 82 | <div class="clearfix visible-sm-block visible-md-block visible-lg-block"></div>
|  | 83 | #end
|  | 84 | <div class="col-xs-12 col-sm-6">
|  | 85 | #helpActionCard($card)
|  | 86 | </div>
|  | 87 | #end
|  | 88 | </div>
| 3.1 | 89 | <h3 id="HExamples">$services.localization.render('help.templates.examples.title')</h3>
|  | 90 | <p>$services.localization.render('help.templates.examples.description')</p>
| 1.1 | 91 | <div class="row">
|  | 92 | #foreach ($card in $exampleCards)
|  | 93 | ## See http://getbootstrap.com/css/#grid-responsive-resets .
|  | 94 | #if ($foreach.index > 0 && $foreach.index % 2 == 0)
|  | 95 | <div class="clearfix visible-sm-block "></div>
|  | 96 | #end
|  | 97 | #if ($foreach.index > 0 && $foreach.index % 3 == 0)
|  | 98 | <div class="clearfix visible-md-block"></div>
|  | 99 | #end
|  | 100 | #if ($foreach.index > 0 && $foreach.index % 4 == 0)
|  | 101 | <div class="clearfix visible-lg-block"></div>
|  | 102 | #end
|  | 103 | <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
| 2.1 | 104 | #set ($outputCard = {})
|  | 105 | #getTemplateExample($card $outputCard)
|  | 106 | #helpExampleCard($outputCard)
| 1.1 | 107 | </div>
|  | 108 | #end
|  | 109 | </div>
| 3.1 | 110 | <p><a href="http://extensions.xwiki.org/xwiki/bin/view/Extension/Templates+Application/" class="wikiexternallink">$services.localization.render('help.templates.more')</a></p>
| 1.1 | 111 | {{/html}}
|  | 112 | {{/velocity}}

# Applications

# Tips

Jump to any page in the wiki with Ctrl+G or Meta+G.
See more shortcuts.

# Need help?

If you need help with XWiki you can contact:

- Community Support
- Professional Support

XWiki Debian 11.5