Document title in a translation document
Hi I want to retrieve the "title" of the document - which is added in the "title" field just above the document content editor field. I can use something like $doc.getTitle() in the default document (in English). But when I use it in French it gives me the title of the English (default) document. I tried a couple of other functions from the Api but I can't find the right one. I am sure there is a way to retrieve this information but I don't know how. I am using Xwiki unstable (1252 on Jetty and HSQL). And I appreciate your help. Marc Lijour Agent d'éducation Direction des politiques et programmes d'éducation en langue française Ministère de l'Éducation 8e étage, édifice Mowat 900, rue Bay Toronto (Ontario) M7A 1L2 Téléphone : 416 325-3501 Télécopieur : 416 325-2156 <<Lijour, Marc (EDU).vcf>>
Hi, for having the traduction, use $tdoc (translated document) instead of $doc $tdoc.title jeremi On 9/11/06, Lijour, Marc (EDU) <[email protected]> wrote:
Hi
I want to retrieve the "title" of the document - which is added in the "title" field just above the document content editor field.
I can use something like $doc.getTitle() in the default document (in English). But when I use it in French it gives me the title of the English (default) document.
I tried a couple of other functions from the Api but I can't find the right one. I am sure there is a way to retrieve this information but I don't know how.
I am using Xwiki unstable (1252 on Jetty and HSQL). And I appreciate your help.
Marc Lijour Agent d'éducation Direction des politiques et programmes d'éducation en langue française Ministère de l'Éducation 8e étage, édifice Mowat 900, rue Bay Toronto (Ontario) M7A 1L2 Téléphone : 416 325-3501 Télécopieur : 416 325-2156 <<Lijour, Marc (EDU).vcf>>
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- jeremi
Thank you Jeremi. I still didn't obtain the complete effect I was looking for. But thanks to your explanations and a little trip in the API doc (http://build.xpertnet.biz/doc/api/com/xpn/xwiki/api/Document.html). I could solve my problem. I send the question and the solution here in hope that it will save some time to somebody in the future. However, I don't see why $doc and $tdoc should behave differently. Forgive my lack of knowledge, I am new to Xwiki. 1) Question I noticed that $doc and $tdoc behave differently when documents are included. I use #includeTopic() to include a page containing a reference to $tdoc.title but instead of giving me the title of the included document it gives me the title of the containing document (the one with the macro call). $doc does not behave like this. $doc.title is always evaluated in the current document before it is included anywhere else. Is there a way to get the title of an included translated document of the same language as the current document? For example, I view a French catalog including 3 parts. Xwiki is smart enough to show me the 3 parts in French. But how do I print programmatically their titles into their content (page)? 2) Solution Use $doc.getTranslatedDocument().title instead of $tdoc.title ---- Hi, for having the traduction, use $tdoc (translated document) instead of $doc $tdoc.title jeremi On 9/11/06, Lijour, Marc (EDU) <[email protected]> wrote:
Hi
I want to retrieve the "title" of the document - which is added in the
"title" field just above the document content editor field.
I can use something like $doc.getTitle() in the default document (in English). But when I use it in French it gives me the title of the English (default) document.
I tried a couple of other functions from the Api but I can't find the right one. I am sure there is a way to retrieve this information but I
don't know how.
I am using Xwiki unstable (1252 on Jetty and HSQL). And I appreciate your help.
participants (2)
-
jeremi joslin -
Lijour, Marc (EDU)