[TYPO3-dev] Problems with plugin and workspaces/versioning
Wolfgang Klinger
wolfgang at stufenlos.net
Thu Sep 21 16:00:34 CEST 2006
Hi,
this is what I do:
I switch to my workspace "WS1", create a new version of a page,
add a new content element to that page of type "user_myext_pi1";
On another page there's a content element of type "user_myext_pi2"
("live") which shows a list of all elements of type "user_myext_pi1"
using this code:
------
$limit = 'LIMIT 10';
$query = ' SELECT * FROM tt_content
WHERE CType = "user_myext_pi1"'.$this->cObj->enableFields('tt_content').'
ORDER BY sorting '.$limit;
if ($res = $TYPO3_DB->sql_query($query)) {
while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
$TSFE->sys_page->versionOL('tt_content', $row);
if (is_array($row)) {
$parent_info = $TSFE->sys_page->getPage($row['pid']);
$TSFE->sys_page->fixVersioningPid('pages', $parent_info);
if ($parent_info['pid'] != -1) {
$records[] = $row;
}
}
}
}
------
That looks a little bit complicated, is there a better way?
tia, bye
Wolfgang
More information about the TYPO3-dev
mailing list