[TYPO3] valid GMENUs

Curt Grimley curt at cgss.net
Wed Apr 19 06:07:57 CEST 2006

Christian Vetter wrote:
> Hi folks,
> I want my web sites to be valid XHTML 1.1 - thus I can't have stuff like 
> 'border="0"' in my img-tags. How can I get rid of that for my 
> GMENU/Gifbuilder objects ? In the documentation I haven't found a thing 
> on that.
> I use Typo3 4.0.
> Best regards,
> Christian

Hi Christian, good question... is it still an issue for you (two days 

I found the border="0" is built in (typo3/tslib/class.tslib_menu.php, 
line 2245). Of course, you do not want to modify that file.

But about ten lines later you see an opportunity to process the links 
using the IProcFunc user function feature (see TSRef).

So I tried one and it works, like this:

Typoscript (only pertinent lines shown):

	includeLibs.myproc = fileadmin/scripts/my_menuIProcFunc.php
	temp.mymenu = HMENU
	temp.mymenu.1 = GMENU
	temp.mymenu.1.IProcFunc = user_menuIProcFunc

Php script file (fileadmin/scripts/my_menuIProcFunc.php):

	function user_menuIProcFunc($I,$conf)   {
	        $I['parts'] = str_replace('border="0"','',$I['parts']);
	        return $I;

Now you just need to make sure your .css deals with the border attribute 
of img tags. Or if you want you could plug in style notation when you do 
the str_replace (above).

Actually there are a lot of places in Typo3 that you can add your own 
functionality, just search TSRef for "function-name". Hope that helps! ~cg

More information about the TYPO3-english mailing list