[TYPO3-english] Replace images with ALT text

Graham Solomon graham.solomon at powys.gov.uk
Mon Feb 23 14:11:18 CET 2009


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