Changes for page Templates

Last modified by superadmin on 06.01.2023 13:12

From version 1.1
edited by XWiki Admin
on 30.05.2017 10:40
Change comment: Install extension [org.xwiki.contrib:application-help-center-1.1]
To version 2.1
edited by superadmin
on 06.01.2023 13:12
Change comment: Install extension [org.xwiki.platform:xwiki-platform-help-ui/14.10.2]

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Templates
1 +$services.localization.render('help.templates.title')
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Admin
1 +XWiki.superadmin
Content
... ... @@ -1,13 +1,16 @@
1 1  {{include reference="Help.Code.VelocityMacros" /}}
2 2  
3 3  {{velocity output="false"}}
4 +#set ($featuresPrefix = 'https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features')
5 +#set ($exoPrefix = 'https://extensions.xwiki.org/xwiki/bin/view/Extension')
4 4  #set ($actionCards = [{
5 - 'title': 'Use templates',
6 - 'description': 'Templates are predefined pages that can be copied when creating a new page.',
7 - 'tip': "<a href=""http://platform.xwiki.org/xwiki/bin/view/Features/DocumentLifecycle#HCreate"" class=""wikiexternallink"">Creating pages</a> based on templates makes it faster to adapt predefined content to your needs.",
7 + 'title': $services.localization.render('help.templates.useTemplates.title'),
8 + 'description': $services.localization.render('help.templates.useTemplates.description'),
9 + 'tip': $services.localization.render('help.templates.useTemplates.tip',
10 + ["<a href='$featuresPrefix/DocumentLifecycle#HCreate' class='wikiexternallink'>",'</a>']),
8 8   'thumbnail': 'Template',
9 9   'actions': [{
10 - 'label': 'Try it!',
13 + 'label': $services.localization.render('help.try.label'),
11 11   'type': 'success',
12 12   'url': $xwiki.getURL('Sandbox.WebHome', 'create', $escapetool.url({
13 13   'title': "New Page $datetool.get('dd MMM yyyy, HH:mm')"
... ... @@ -14,43 +14,63 @@
14 14   }))
15 15   }]
16 16  }, {
17 - 'title': 'Create your template',
18 - 'description': 'Integrate structure and macros in an existing page, and transform it in a template.',
19 - 'tip': "<a href=""http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application#HCreatetheTemplateProvider"" class=""wikiexternallink"">Template Providers</a> expose templates on the Create Page dialog so that the users can use them.",
20 + 'title': $services.localization.render('help.templates.create.title'),
21 + 'description': $services.localization.render('help.templates.create.description'),
22 + 'tip': $services.localization.render('help.templates.create.tip',
23 + ["<a href='$exoPrefix/Administration+Application#HCreatetheTemplateProvider' class='wikiexternallink'>",'</a>']),
20 20   'thumbnail': 'Administration',
21 21   'actions': [{
22 - 'label': 'Learn more',
23 - 'url': 'http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application#HCreatetheTemplateProvider'
26 + 'label': $services.localization.render('help.more.label'),
27 + 'url': "$exoPrefix/Administration+Application#HCreatetheTemplateProvider"
24 24   }]
25 25  }])
26 26  
27 27  #if ($hasAdmin)
28 28   #set ($discard = $actionCards[1].actions.add(0, {
29 - 'label': 'Browse',
33 + 'label': $services.localization.render('help.browse.label'),
30 30   'url': $xwiki.getURL('XWiki.XWikiPreferences', 'admin', 'editor=globaladmin&section=Templates')
31 31   }))
32 32  #end
33 33  
38 +#macro (getTemplateExample $inputCard $outputCard)
39 + #set ($templateReference = $services.model.resolveDocument($inputCard.templateReference))
40 + #if ($xwiki.getDocument($templateReference).isNew())
41 + #set ($outputCard = {
42 + 'title': $inputCard.title,
43 + 'description': $inputCard.description,
44 + 'documentation': "$exoPrefix/Templates+Application/",
45 + 'thumbnail': $inputCard.thumbnail
46 + })
47 + #else
48 + #set ($outputCard = {
49 + 'title': $inputCard.title,
50 + 'description': $inputCard.description,
51 + 'examples': $inputCard.templateReference,
52 + 'thumbnail': $inputCard.thumbnail
53 + })
54 + #end
55 +#end
56 +
34 34  #set ($exampleCards = [{
35 - 'title': 'Article',
36 - 'description': 'Article page',
37 - 'examples': 'Help.Templates.Article.WebHome',
38 - 'thumbnail': 'Help.Templates.Article.WebHome@article.png'
58 + 'title': $services.localization.render('help.templates.article.title'),
59 + 'description':$services.localization.render('help.templates.article.description'),
60 + 'templateReference': 'Templates.Article.Template.WebHome',
61 + 'thumbnail': 'Help.Templates.WebHome@article.png'
39 39  }, {
40 - 'title': 'Encyclopedia',
41 - 'description': 'Encyclopedia page',
42 - 'examples': 'Help.Templates.Encyclopedia.WebHome',
43 - 'thumbnail': 'Help.Templates.Encyclopedia.WebHome@encyclopedia.png'
63 + 'title': $services.localization.render('help.templates.encyclopedia.title'),
64 + 'description': $services.localization.render('help.templates.encyclopedia.description'),
65 + 'templateReference': 'Templates.Encyclopedia.Template.WebHome',
66 + 'thumbnail': 'Help.Templates.WebHome@encyclopedia.png'
44 44  }, {
45 - 'title': 'Meeting Report',
46 - 'description': 'Agenda and notes',
47 - 'examples': 'Help.Templates.Meeting.WebHome',
48 - 'thumbnail': 'Help.Templates.Meeting.WebHome@meeting.png'
68 + 'title': $services.localization.render('help.templates.meeting.title'),
69 + 'description': $services.localization.render('help.templates.meeting.description'),
70 + 'templateReference': 'Templates.Meeting.Template.WebHome',
71 + 'thumbnail': 'Help.Templates.WebHome@meeting.png'
49 49  }, {
50 - 'title': 'Simple Page',
51 - 'description': 'With table of contents',
52 - 'examples': 'Help.Templates.Simple.WebHome',
53 - 'thumbnail': 'Help.Templates.Simple.WebHome@simple.png'
73 + 'title': $services.localization.render('help.templates.simple.title'),
74 + 'description': $services.localization.render('help.templates.simple.description'),
75 + 'templateReference': 'Templates.SimplePage.Template.WebHome',
76 + 'thumbnail': 'Help.Templates.WebHome@simple.png'
54 54  }])
55 55  {{/velocity}}
56 56  
... ... @@ -67,8 +67,8 @@
67 67   </div>
68 68   #end
69 69  </div>
70 -<h3 id="HExamples">Examples</h3>
71 -<p>Want to start from a predefined template? Here are some examples of available templates inside XWiki.</p>
93 +<h3 id="HExamples">$services.localization.render('help.templates.examples.title')</h3>
94 +<p>$services.localization.render('help.templates.examples.description')</p>
72 72  <div class="row">
73 73   #foreach ($card in $exampleCards)
74 74   ## See http://getbootstrap.com/css/#grid-responsive-resets .
... ... @@ -82,10 +82,12 @@
82 82   <div class="clearfix visible-lg-block"></div>
83 83   #end
84 84   <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
85 - #helpExampleCard($card)
108 + #set ($outputCard = {})
109 + #getTemplateExample($card $outputCard)
110 + #helpExampleCard($outputCard)
86 86   </div>
87 87   #end
88 88  </div>
89 -<p><a href="http://extensions.xwiki.org/xwiki/bin/view/Extension/Templates+Application/" class="wikiexternallink">View more templates</a></p>
114 +<p><a href="$exoPrefix/Templates+Application/" class="wikiexternallink">$services.localization.render('help.templates.more')</a></p>
90 90  {{/html}}
91 91  {{/velocity}}
article.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.superadmin
Size
... ... @@ -1,0 +1,1 @@
1 +376.1 KB
Content
encyclopedia.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.superadmin
Size
... ... @@ -1,0 +1,1 @@
1 +331.5 KB
Content
meeting.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.superadmin
Size
... ... @@ -1,0 +1,1 @@
1 +83.5 KB
Content
simple.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.superadmin
Size
... ... @@ -1,0 +1,1 @@
1 +180.8 KB
Content