It is easy to embed graphics with TypoScript. This is done with the IMAGE
object, whose most important property is file
. One precondition is that the marker ###IMAGE###
has been inserted in the template:
page.10.marks { IMAGE = IMAGE IMAGE.file = fileadmin/_temp_/images/logo.jpg }
This syntax is all you need to load the graphic from the specified directory and to create the appropriate HTML code in the back end.
<img src="fileadmin/_temp_/images/logo.jpg" width="788" height="150" border="0" alt="" title="" />
There is one problem with this syntax: The alt
and title
attributes have no value. This is easily changed:
page.10.marks{ IMAGE = IMAGE IMAGE.file = fileadmin/_temp_/images/logo.jpg IMAGE.altText = Hello, World! IMAGE.titleText = Hello, World! }
This assigns an appropriate value to title
and alt
. There is also the archaic value alttext
, but it should only be used if altText
doesn't have a value.