Change comment:
Install extension [org.xwiki.platform:xwiki-platform-blog-ui-8.2.1]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.m florea1 +XWiki.ThomasMortagne - Content
-
... ... @@ -1,9 +1,8 @@ 1 -{{include document="Blog.BlogCode"/}}1 +{{include reference="Blog.BlogCode"/}} 2 2 3 -{{include document="Blog.CategoriesCode"/}}3 +{{include reference="Blog.CategoriesCode"/}} 4 4 5 5 {{velocity}} 6 -{{html clean="false" wiki="true"}} 7 7 $xwiki.jsx.use('Blog.ManageCategories', {'mode' : 'select'})## 8 8 $xwiki.ssx.use('Blog.ManageCategories')## 9 9 #getEntryObject($doc $entryObj) ... ... @@ -17,6 +17,12 @@ 17 17 ## displayBlog requires a list of documents, and whether to display only an extract or the full entry. 18 18 #displayBlog([$tdoc] 'single' false false) 19 19 #else 19 + #if ("$!request.title" != '') 20 + ## Use the page title specified on the request, if available, as blog post title. This is needed for instance when 21 + ## we create the blog post using the Create Page wizard with the blog post template provider (the user is specifying 22 + ## the page title). 23 + #set ($discard = $entryObj.set('title', $request.title)) 24 + #end 20 20 ; {{translation key='xe.blog.sheet.title'/}} 21 21 : $doc.display('title', 'edit', $entryObj) 22 22 ; {{translation key='xe.blog.sheet.content'/}} ... ... @@ -24,8 +24,19 @@ 24 24 ; {{translation key='xe.blog.sheet.summary'/}} 25 25 : $doc.display('extract', 'edit', $entryObj) 26 26 ; {{translation key='xe.blog.sheet.category'/}} 27 - : (((#displayCategoryManagementTree('' 'selectable') (% class="clearfloats" %)((()))))) 28 - #isPublished($entryObj $isPublished) 32 + : ((({{html clean="false" wiki="true"}}#displayCategoryManagementTree('' 'selectable'){{/html}} (% class="clearfloats" %)((()))))) 33 + #if ($doc.isNew()) 34 + ## We're creating a new blog post. We handle this case differently because #isPublished returns true when the 35 + ## property is not set (object missing) and thus the new blog post will appear as published. See also the comment 36 + ## from the else branch below. 37 + #set ($isPublished = false) 38 + #else 39 + ## We're editing an existing blog post. We need to check the original document because the current one can have 40 + ## unsaved changes, which happens for instance after returning from preview. 41 + #set ($originalDocument = $xwiki.getDocument($doc.documentReference)) 42 + #getEntryObject($originalDocument $originalEntryObj) 43 + #isPublished($originalEntryObj $isPublished) 44 + #end 29 29 #if($isPublished) 30 30 #if($doc.creator == $xcontext.user) 31 31 #publishMessageBox($services.localization.render('xe.blog.sheet.publicationdate', [${doc.display('publishDate', 'view', $entryObj)}])) ... ... @@ -38,8 +38,9 @@ 38 38 ## The publish date was not set, force it to be the creation date 39 39 $entryObj.set('publishDate', $doc.creationDate) 40 40 #end 57 + {{html clean="false" wiki="true"}} 41 41 #publishMessageBox("$services.localization.render('xe.blog.sheet.notpublished') <label>**$services.localization.render('xe.blog.sheet.publish') ${doc.display('published', 'edit', $entryObj)}**</label>\\<label>$services.localization.render('xe.blog.sheet.setdate') ${doc.display('publishDate', 'edit', $entryObj)}</label>") 59 + {{/html}} 42 42 #end 43 43 #end 44 -{{/html}} 45 45 {{/velocity}}