Display the page when it is completely Loaded

Hello All!

The following code helps you to display the contents of the page after it is completely loaded. It uses the JQuery for this purpose.

Initially wrap the whole page in a <div> tag and hide it using CSS.

The HTML code is as follows….
<html>
<title>…..</title>
<body>
<div id=”my_testid”>
.
.
.
.
.
</div>
</body>
</html>

The Css for the div is as follows
#my_testid{
.
.
.
display:none;
}

Now Using the jQuery change the display property when the page is completely Loaded. For this to work we have “window.onload” option in jQuery
<script type=”text/javascript”>
jQuery(document).ready(function(){
window.onload = function (){ jQuery(‘#my_testid’).show(); };
});
</script>

Display Image when both path and file name are in two fields

The following code gives an overview of how to display an IMAGe when 2 fields are involved.
That is one contains the image path “fileadmin/templates/imgs/” and the other field has the image name “mylogo.png”

10 = IMAGE
10 {
file.import {
cObject = COA
cObject {
10 = TEXT
10.data = field:image_path
20 = TEXT
20.data = field:image_name
}
}
}

Hope this helps.

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.