[TYPO3] Getting localized page title

Francois Suter fsuter at cobweb.ch
Fri Aug 18 18:31:30 CEST 2006


Hi all,

I'm trying to create a permanent link to a given page in my web site,  
with the page title as the text of the link. I started with something  
like this:

lib.left_pages.stdWrap {
     prepend = TEXT
     prepend {
         data = DB : pages:{$CW_LEFT_PAGES}:title
         typolink.parameter = {$CW_LEFT_PAGES}
         case = upper
         wrap = <p class="entete">|</p>
     }
}

but thought that the above was maybe making 2 requests to the  
database, so moved on to that.

lib.left_pages.stdWrap {
     prepend = RECORDS
     prepend {
         source = {$CW_LEFT_PAGES}
         tables = pages
         conf.pages = TEXT
         conf.pages {
             field = title
             case = upper
             wrap = <p class="entete">|</p>
         }
     }
}

Both scripts give the same result except that I have one problem: my  
site is one-tree multiple language site and - of course - I want my  
page title to appear in the current language being used and not the  
page language. So I looked at the CONTENT cObj, because it has a  
select function which in turn has a languageField property. But the  
problem is that the pages table doesn't have a language field, since  
translated pages are stored in the pages_language_overlay table. I  
can use different objects depending on whether we are using the  
default language or not, but I was wondering if anyone had a better  
idea?

Cheers

François Suter
Directeur technique
-----------------------------------------------------
Cobweb Development Sàrl
www.cobweb.ch
-----------------------------------------------------




More information about the TYPO3-english mailing list