Blunders due to auto generated content

Recently I was going through Dmitry’s twitter entries, and I suddenly came across a blog titled “The (Often Amusing) Pitfalls of Auto-Generated Content” and I was really amused about the kind of Ads Google made by combining different keywords.

The same day ironically while I was searching for something I ended up in a Google news page here:
http://www.google.com/archivesearch?q=typo3&btnG=Search+Archives&scoring=t

imageimage image

This literally made me believe that Typo3 CMS is aged over 400 years!

I checked out the three news items listed in year 1605, and it seems like Google considers all numbers with four number digit as year! Well if anyone wants to prove that their company has over 500 year old history, here is an opportunity for you 😉

This is another cool instance of a bad program logic or probably not!

date2cal for mailformplus

In order to set date2cal for mailformplus we need to follow 3 important steps:

1. Include the necessary js and css files

page.headerData.80 = TEXT
page.headerData.80.value (
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/calendar.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/date2cal.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/naturalLanguageParser.js"></script>
<link rel="stylesheet" type="text/css" href="typo3conf/ext/date2cal/js/jscalendar/skins/aqua/theme.css" />

)
# add translations
# French – DEFAULT
page.headerData.90 = TEXT
page.headerData.90.value = <script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/lang/calendar-fr.js"></script>

2. Create the target input box and the calendar trigger button

<input type="text" name="datebox" id="datebox" value="###value_datebox###" tabindex="13" maxlength="16" size="9"/>
<img id="datebox_trigger" alt="Calendar" title="Calendar" style="cursor: pointer; vertical-align: middle;" src="typo3conf/ext/date2cal/res/calendar.png"/>

3. Write the calendar instantiation code using JavaScript
(The id of “inputField” and “button” should match the textbox and trigger button)
NOTE: this code must be executed after the above input boxes are loaded!

<script type="text/javascript">
    Calendar.setup({
        inputField     :    "datebox",      // id of the input field
        ifFormat        :    "%d/%m/%Y",       // format of the input field                   
        align          :    "Bl",           // alignment (defaults to "Bl")
        button         :    "datebox_trigger",   // trigger for the calendar (button ID)
        singleClick    :    true,           // single-click mode
    });
</script>

That’s all now you should be able to view the calendar if you click the image!!!

Dynamically change class attribute of body tag using typoscript

This is a small note about how we can change the class attribute of body tag using typoscript.

# bodyTag
page.bodyTag >

page.bodyTagCObject = TEXT
page.bodyTagCObject.data = levelfield:-1 :, myfeildname, slide
page.bodyTagCObject.wrap = <body class="myclass_|">

Well here I am using a custom field added to pages table. If you wish to use the page id you may try using this code below:

# bodyTag
page.bodyTag >

page.bodyTagCObject = TEXT
page.bodyTagCObject.data = field:id
page.bodyTagCObject.wrap = <body class="myclass_|">

This way you may expect body tags like:
<body class="myclass_1">
<body class="myclass_2">

Adding Fields to the Rootline to Enable sliding for custom fields

In certain situations it is necessary to add fields to the rooline so that we can have the sliding feature enabled for these fields.

The fields can be added to rootline fields list through the install tool –> All Config or if you are developing an extension, then you can write the following code in the ext_localconf.php

 

$rootlinefields = &$GLOBALS["TYPO3_CONF_VARS"]["FE"]["addRootLineFields"];
/* Note the ampersand (&) symbol. Don’t Forget it!!! */

$NewRootlinefields = "tx_nmcmenu_overcolor,tx_nmcmenu_outcolor,tx_nmcmenu_actcolor";
$rootlinefields .= ($rootlinefields == ”)?$NewRootlinefields:’,’.$NewRootlinefields;

How to check if a Templavoila Template (TO) is used or not?

This is often a very confusing task for most people, including myself in the beginning.

Using this simple step, it would however be easy to find out whether the TO is used or not.

1. Set to list view from web menu.

web-listview

2. Now select the Storage folder where Templavoila Templates are Stored.

3. Enable the Clipboard, and make sure clipboard 2 is selected.

enabling-clipboard2

4. Now can see some numbers at the extreme right side of each, these numbers indicate the number of times the TO is being used.

to-usage

Move the Mouse over the numbers, and you can even see the uid of a few of them.

That’s all.