[TYPO3-english] Replace images with ALT text

Bob bitsandbob at googlemail.com
Tue Feb 24 10:49:07 CET 2009


Hi Graham,

Thanks for the tip.

But I've having a couple of problems with it...

1) it makes all the the text in my "Text w/Image" content disappear

2) I can't seem to work out how to get it to apply to one page type only

Any ideas what I'm doing wrong?

Thanks,

Bob


Graham Solomon wrote:
> Hi Bob,
> 
> Try adding this typoscript to your template:
> 
> tt_content.image >
> tt_content.image = TEXT
> tt_content.image.field = altText
> tt_content.image.stripHtml = 1
> 
> tt_content.textpic >
> tt_content.textpic = TEXT
> tt_content.textpic.field = altText
> tt_content.textpic.stripHtml = 1
> 
> 
> Regards,
> Graham
> 
> Bob wrote:
>> Hi all,
>>
>> I have set up a page type for a low bandwidth version of a site. This 
>> successfully pulls in a different template with different style 
>> sheets, etc.
>>
>> What I need to do next, is replace all images with their ALT text (for 
>> this page type only).
>>
>> Can anyone give me any pointers on the best way to go about this?
>>
>> Writing the PHP to do the replacements shouldn't be too tricky, but 
>> I'm not sure how to apply this function to the generated HTML. For 
>> example, the following *doesn't* work:
>>
>> pageLo.10 = USER_INT
>> pageLo.10.userFunc = user_lowBandwidth->replaceImages
>> pageLo.10.pageContent < styles.content.get
>>
>> Unfortunately, $conf["pageContent"] does not contain the HTML content 
>> - in fact, it seems to just contain "CONTENT" but I'm guess that it 
>> may be more complicated that that. (I'm sure this would be obvious to 
>> more experienced TYPO3 developers, but I'm still quite new to it!)
>>
>> What the simplest way to process the generated HTML?
>>
>> Thanks,
>>
>> Bob


More information about the TYPO3-english mailing list