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) <Marc.Lijour(a)ontario.ca> 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.