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">

Some of the most important things to know about Linux

 

These settings are applicable to Redhat/ Fedora / CentOS and I am not aware if this holds good even on other Distros.

Important File / Folder Locations

  • Location of HTTPD (Apache) Configuration File:
    /etc/httpd/conf/httpd.conf
  • Location of PHP Configuration File (php.ini):
    /etc/php.ini

Service Related Information

Enabling / Disabling Services
The chkconfig command can be used for enabling / disabling services on Redhat based linux distributions.

EX: # chkconfig httpd –add
EX: # chkconfig httpd on
EX: # chkconfig –list httpd
EX: # chkconfig httpd of
EX: # chkconfig httpd –del

Starting / stopping / a service

service <service name> start/stop
EX: # service httpd stop
EX: # service httpd start

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;