‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\ContentObject\ImageContentObject Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\ContentObject\ImageContentObject:

Public Member Functions

 __construct (protected readonly MarkerBasedTemplateService $markerTemplateService,)
string render ($conf=[])
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
 getContentObjectRenderer ()
 setRequest (ServerRequestInterface $request)
 setContentObjectRenderer (ContentObjectRenderer $cObj)

Protected Member Functions

string cImage ($file, array $conf)
 getImageTagTemplate ($layoutKey, $conf)
string getImageSourceCollection (string $layoutKey, array $conf, $file)
 linkWrap (string $content, string $wrap)
string getAltParam (array $conf)
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
 hasTypoScriptFrontendController ()
 getTypoScriptFrontendController ()
 getPageRepository ()
 getPageRenderer ()

Additional Inherited Members

- ‪Protected Attributes inherited from ‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
PageRenderer $pageRenderer = null
ServerRequestInterface $request
ContentObjectRenderer $cObj = null

Detailed Description

Contains IMAGE class object.

Definition at line 30 of file ImageContentObject.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\ContentObject\ImageContentObject::__construct ( protected readonly MarkerBasedTemplateService  $markerTemplateService)

Definition at line 32 of file ImageContentObject.php.

Member Function Documentation

◆ cImage()

string TYPO3\CMS\Frontend\ContentObject\ImageContentObject::cImage (   $file,
array  $conf 

Returns a tag with the image file defined by $file and processed according to the properties in the TypoScript array. Mostly this function is a sub-function to the IMAGE function which renders the IMAGE cObject in TypoScript.

string | File | FileReference | null$file‪File TypoScript resource
array$conf‪TypoScript configuration properties
‪string HTML tag, (possibly wrapped in links and other HTML) if any image found.

Definition at line 63 of file ImageContentObject.php.

References TYPO3\CMS\Frontend\ContentObject\ImageContentObject\getAltParam(), TYPO3\CMS\Frontend\ContentObject\ImageContentObject\getImageSourceCollection(), TYPO3\CMS\Frontend\ContentObject\ImageContentObject\getImageTagTemplate(), TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getPageRenderer(), TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getTypoScriptFrontendController(), and TYPO3\CMS\Frontend\ContentObject\ImageContentObject\linkWrap().

Referenced by TYPO3\CMS\Frontend\ContentObject\ImageContentObject\render().

◆ getAltParam()

string TYPO3\CMS\Frontend\ContentObject\ImageContentObject::getAltParam ( array  $conf)

An abstraction method which creates an alt or title parameter for an HTML img, applet, area or input element and the FILE content element. From the $conf array it implements the properties "altText" and "titleText"

array$conf‪TypoScript configuration properties
‪string Parameter string containing alt and title parameters (if any)

Definition at line 265 of file ImageContentObject.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\ImageContentObject\cImage().

◆ getImageSourceCollection()

string TYPO3\CMS\Frontend\ContentObject\ImageContentObject::getImageSourceCollection ( string  $layoutKey,
array  $conf,

Render alternate sources for the image tag. If no source collection is given an empty string is returned.

string$layoutKey‪rendering key
array$conf‪TypoScript configuration properties
string | File | FileReference | null$file

Definition at line 141 of file ImageContentObject.php.

References TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getPageRenderer(), TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getTypoScriptFrontendController(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\ContentObject\ImageContentObject\cImage().

◆ getImageTagTemplate()

TYPO3\CMS\Frontend\ContentObject\ImageContentObject::getImageTagTemplate (   $layoutKey,

Returns the html-template for rendering the image-Tag if no template is defined via typoscript the default tag template is returned

string$layoutKey‪rendering key
array$conf‪TypoScript configuration properties

Definition at line 125 of file ImageContentObject.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\ImageContentObject\cImage().

◆ linkWrap()

TYPO3\CMS\Frontend\ContentObject\ImageContentObject::linkWrap ( string  $content,
string  $wrap 

Wraps the input string by the $wrap value and implements the "linkWrap" data type as well.

The "linkWrap" data type means that this function will find any integer encapsulated in {} (curly braces) in the first wrap part and substitute it with the corresponding page uid from the rootline where the found integer is pointing to the key in the rootline.

string$content‪Input string
string$wrap‪A string where the first two parts separated by "|" (vertical line) will be wrapped around the input string

Definition at line 245 of file ImageContentObject.php.

References TYPO3\CMS\Webhooks\Message\$uid.

Referenced by TYPO3\CMS\Frontend\ContentObject\ImageContentObject\cImage().

◆ render()

string TYPO3\CMS\Frontend\ContentObject\ImageContentObject::render (   $conf = [])

Rendering the cObject, IMAGE

array$conf‪Array of TypoScript properties
‪string Output

Reimplemented from TYPO3\CMS\Frontend\ContentObject\AbstractContentObject.

Definition at line 42 of file ImageContentObject.php.

References TYPO3\CMS\Frontend\ContentObject\ImageContentObject\cImage().