Translate field in FCE

Generally FCE cannot be translated, like normal tables. How we may use two fields like field_fr, field_en, and then display the related info according to the language.

  
EX:
      
10 = COA
10 {
#Translation for primary language (L=0) 30 = TEXT 30.field = field_slide_info 30.stdWrap.wrap = <p>|</p> 30.if { value = 0 equals.data = gp:L }
    #Translation for second language (L=1)
40 = TEXT 40.field = field_slide_info_en 40.stdWrap.wrap = <p>|</p> 40.if { value = 1 equals.data = gp:L } }

Tesseract Tips / Notes

DATA FILTER:

Clear Filter/Query Cache: In some situations when “Additional SQL” field is cleared, the dataquery may still be using the cached value from this field.
In such case we should add following URL Parameter, which informs DataQuery to re-build the query from scratch.

EX:
www.example.com/?clear_cache = 1

Using main.subtable: When we wish to apply a specific condition to a sub-table, the query is applied on the JOIN itself:

EX 1:
subtable.uid = vars:event
maintable.uid = varsproject

This is translated to someting like this:

SELECT maintable.*, subtable.*
FROM maintable JOIN subtable
ON maintable.event_id = subtable.uid AND subtable.uid = 20
WHERE
maintable.uid = 45

However, if we add main.subtable.uid… the query gets converted to as shown below:
EX 2:
main.subtable.uid = vars:event
maintable.uid = varsproject

This is translated to someting like this:

SELECT maintable.*, subtable.*
FROM maintable JOIN subtable
ON maintable.event_id = subtable.uid
WHERE
subtable.uid = 20 AND maintable.uid = 45

Avoid translation of field using TCA and l10n_mode

For a field which must not really be translated (such as a event date)

l10n_mode : exclude ( do not translate this)
l10n_display : defaultAsReadOnly ( show field as read only in translated
records)

This way translators see the field data, but can’t change it. This is the most logical for such a field.
Please refer doc_core_tca for more details about these two settings.

Displaying page title : Various methods

Getting page title for a specific page (using uid)

METHOD 1:

temp.pTitle = HMENU
temp.pTitle {
special = list
special.value = {$my_page_uid}
1 = TMENU
1 {
NO {
doNotLinkIt = 1
}
}
}

METHOD 2: (The localization may not work fine in the below method)

lib.pagetitle = RECORDS
lib.pagetitle {
source.data = page:uid
tables = pages
conf.pages = TEXT
conf.pages.field = nav_title
}

Getting Current Page Title:

lib.pagetitle = TEXT
lib.pagetitle.field=title

Page title of parent page:

lib.pagetitle = TEXT
lib.pagetitle.data = leveltitle:-2
OR
lib.pagetitle = TEXT
lib.pagetitle.data = leveltitle:-3

Inserting page title within a HMENU

temp_pagetitle = TEXT
temp_pagetitle.data = leveltitle:-2

leftMenu = HMENU
leftMenu.stdWrap.preCObject < temp.leftmenu_pagetitle
leftMenu.1 = TMENU
leftMenu.1.wrap = <ul class=”cw_leftmenu”>|</ul>
leftMenu.1.NO.wrapItemAndSub = <li>|</li>
leftMenu.1.ACT = 1
leftMenu.1.ACT.wrapItemAndSub = <li>|</li>
leftMenu.1.ACT.allWrap = <span class=”active_menu”>|</span>
leftMenu.1.CUR = 1
leftMenu.1.CUR.allWrap = <span class=”cur_menu”>|</span>
leftMenu.2 < .1
leftMenu.3 < .2