[TYPO3-mvc] create new page in frontend

Martin Weymayer office at weymayer.at
Tue Sep 29 22:37:35 CEST 2015


hello,

i have an extension where frontend user can create new entries. the new entries should be saved in a new page. i found following which is only working if i am also logged in in backend (Fatal error: Call to a member function writelog() on a non-object in /home/xxx/public_html/xxx/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 7356):

$data = array(
					'pages' => array(
						'NEW' => array(
							'pid' => 56,
							'title' => 'Title for new page',
							'hidden' => 0,
						),
					)
				);
				
					
				$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
				$tce->stripslashes_values = 0;
				$tce->reverseOrder = 0;
				$tce->start($data, array());
				$tce->process_datamap();
				\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
				$tce->clear_cacheCmd('pages');

so, is there also an easy way to create a new page in controller?

thanks for help!
martin


More information about the TYPO3-project-typo3v4mvc mailing list