[TYPO3-mvc] Typo3 6 Extension: get page resources Media
Hendrik Nadler
nadler at simplethings.de
Tue Jun 18 17:42:23 CEST 2013
Hi,
as there were/are no answers to this question, i have to ask again ;-) For an extension i wrote a simple pagesModel and pagesRepository:
class Pages extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
...
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
*/
protected $media;
...
class PagesRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
...
TypoScript:
plugin.tx_foo.persistence.classes {
Foo\Bar\Domain\Model\Pages
mapping {
tableName = pages
columns {
title.mapOnProperty = title
abstract.mapOnProperty = abstract
media.mapOnProperty = media
}
}
}
If i try to select some pages and assign them tot he view it works, but there are no {page.media} entries... Any idea what i am missing? Thx.
Regards, Hendrik
-----Ursprüngliche Nachricht-----
Von: Dorian [mailto:dk at digitalwerk.at]
Gesendet: Freitag, 1. Februar 2013 10:58
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] Typo3 6 Extension: get page resources Media
Hello,
does anybody know how to get the Pics uploaded at Page -> Resoources -> Media?
I'm looping through all subpages of the current site and want to display a teaser picture, which is uploaded at the page resources...
public function listAction() {
$landingPages = $this->landingPageRepository->findAll();
$markerArray = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'pid='.$GLOBALS["TSFE"]->id);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
$markerArray[] = array('uid' => $row['uid'], 'title' => $row['title']);
// Page Resource Bild auslesen
}
$this->view->assign('teaser', $markerArray);
$this->view->assign('teaser1', $landingPages);
}
Thank you :)
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list