When using RealURL in multi language environment sending an real 404 is sometimes not so easy. Some I just want to give you some hints:
First of all enable the pageNotFound_handling of Typo3.
- open the file
typo3conf/localconf.php
- add these lines
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] = 'http://www.my-domain.com/en/not-found.html';
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling_statheader"] = 'HTTP/1.1 404 Not Found';
Now you need to check your RealURL config:
- Be sure you that you have not set
postVarSet_failureMode OR set it to postVarSet_failureMode=''
- Also be sure you have defined
'noMatch'=>'bypass' for every single preVars section!
That’s all
Now you get the your wonderful 404 file not found page every time when a wrong page is hit.
Tags:
If you like to use the link wizard to link to an internal or external url you may want to change the start tab. You can to this very easy. Just open the tca.php of your extension. Find the field you want to change and replace "script" => "browse_links.php?mode=wizard", with "script" => "browse_links.php?mode=wizard&act=page", to start with the internal link selector.
Tags:
Using the the typoLink function in your own Typo3 extension is very simple. First you need an instance of the tslib_cObj object. Then setup the config array and call the method. That’s all.
To create the instance you need to include the object first:
include_once(PATH_site.'typo3/sysext/cms/tslib/class.tslib_content.php');
Then create the tslib_cObj:
$cObj=t3lib_div::makeInstance('tslib_cObj');
Setup the config array: (See the typoLink documentation of possible entries)
$conf = array( 'parameter' => 'http://www.bstar.de' );
Call the method:
echo $cObj->typoLink('bstar.de', $conf );
If you don’t want to setup the conf array and don’t need the power of
typoLink you can use
getTypoLink also:
echo $cObj->getTypoLink('bstar.de', 'http://www.bstar.de' );
Tags:
When you are using cron to do some automatic jobs and want the output to be mailed, be sure you are entering the mail address in the right format. In this case it means that the mail address must not contain an “_” (underscore)! If you enter into the MAILTO env of the crontab a mail address which contains an underscore you’ll wait forever 
Of course this behavior depends of your cron version …
So don’t use an underscore when ever you are able to do.
Tags:
Again I need to talk about the default section of the locallang.xml. When you are following the tip of my last post you may encounter an other problem. You don’t have a default anymore (yeah! I know I suggest to remove the default section). This is may a problem if you need to handle many languages and don’t had translate all of them right now.
So here comes my bad work-around.
- open
../t3lib/class.t3lib_div.php in an editor
- search for:
$LOCAL_LANG['default'][$labelKey] = $csConvObj->utf8_decode($labelValue,'iso-8859-1');
- replace
'iso-8859-1' with $origCharset
- save the file
- you may need to clear you llxml cache
Now you can use the default section again and UTF-8 characters are working fine.
Tags:
After you had finally master your the utf8 convert of you Typ3 installation may encounter an other problem. Your own extension is not producing utf8 output.
Your first idea will be to add "SET NAMES UTF8;" to you database connection when using the DBAL of Typo3. But this is not your problem
$GLOBALS['TYPO3_DB']->exec_SELECTquery (which is actually using the DBAL) gives your right want you want!
After a while you’ll may find out that you’ve used for some reasons htmlentities. And this is your problem! But don’t panic. You just need to added some more parameters and the world will be fine again. Just add ‘UTF-8′ as third parameter to give the function a hint that you are using uft8. Tricky … isn’t it
So it will look similar like this:
$str = htmlentities( $dbData, ENT_COMPAT, 'UTF-8' );
Tags:
Building a multi language site can be very hard. First of all you need be sure that you are running Typo3 and your database with the correct encoding. UTF-8 is your friend! Apply all the setting you need for you installation (have a look at http://wiki.typo3.org/index.php/UTF-8_support will may help you) and also ensure your database is using UTF-8. (BTW: If you database tables are using UFT-8 you do NOT need to set $TYPO3_CONF_VARS['SYS']['multiplyDBfieldSize'] and do not forget to run database->compare of the installation tool)
Now your Typo3 installation is working fine. Really? Have you checked your own extensions? Ups! There is may a problem if you use getLL and locallang.xml. Some chars are may mess up even if the locallang.xml looks fine (of course you are using an UTF-8 enabled editor and you are saving this file as UTF-8).
The problem is the “default” languageKey setting. You are not allowed to use any encoding then ansi. But what if you need some special chars there? Be sure you set an other default key (for example “config.language = en” will do this job for english) and rename “default” to “en”. Now you are fine!
Tags:
Please keep in mind that you need to translate your SysFolder to use this feature!!!!!! Otherwise you need to go the hard way …
Tags:
Insert these lines after the root entry of the DS:
<meta>
<langChildren>1</langChildren>
</meta>
<root>...</root>
Tags:
Hey … it’s very simple to get the last sql statement. Before the execution of the statement write this:
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
Then execute the statement. After that you can query the sql string with:
echo $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
Tags: