We all may know the following snippet that gets the first entry of the media field of a page to e.g. display a header image on a page.
10 = IMAGE
10.file {
import = uploads/media/
import.data = levelmedia: 0, slide
import.listNum = 0
}
I am creating an extension (plugin, no ItemuserFunc etc) which needs to work with this media. I don't want to process dozens of typoscript directives in php to create this images. How can I use the example above to process the media field through typoscript, using core functionality instead of reinventing the wheel?
So now I'm in my extension code, having an array of page records. How to get further? The code below doesn't provide the functionality I need because I am not working on the page level (like I would when using the TS from above in a TMENU).
$content .= $this->cObj->stdWrap($page['media'], $this->conf['media_stdWrap.']);