the HTML <title> as shown in the browser is not the same as the document title
(which you can indeed set with  $doc.setTitle("...")   )

Instead you can look in the file
  .../xwiki/skins/flamingo/htmlheader.vm

where the html title is computed - look for the section starting with the 
comment "Compute the title"

There you can see how the HTML title is computed, and indeed how the space 
preferences are used to display a different HTML title
and that it only reads space preferences.

You can edit that file, or create a new skin as explained here:  
http://platform.xwiki.org/xwiki/bin/view/DevGuide/Skins
and edit a copy of it in your new custom skin.

I guess in your use case the first step is to access the $doc variable in the 
template and check if it is one of your special cases,
and if it is, compute the $title differently.

Side note: if you want to track down how XWiki renders a page, you can start at 
skins/flamingo/view.vm
and if a *.vm is included that does not exist in that skin, you can find it in 
the "templates" directory instead.


----- Ursprüngliche Nachricht -----
Von: Jack
Am:  Friday, 29.04.2016, 05:21
An: Xwiki Users
Betreff: [xwiki-users] how to cover one page title


> the default title should be "$doc.web - $doc.name"
> I hope cover one page title (as blog main page) ,I know that  Space
> Preferences make a different title for each space,but I just want to cover a
> page title 
> I try to use velocity code In the blog.Webhome as:
> 
> {{velocity}}
> $doc.setTitle("My new title")
> {{/velocity}}
> 
> it's not working
> 
> Is there any other way to cover a page title without modifying the database?
> 
> 
> 
> 
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/how-to-cover-one-page-title-tp7599271.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
> 
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to