[TYPO3-dev] Dynamically load TS/CSS/JS/HTML based on the new backend layout

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Tue Mar 22 10:29:51 CET 2011


Thomas "Thasmo" Deinhamer wrote:
> I'd prefer avoiding a hook, after I had a look at it again.
> To have the most flexibility, it would be great to somehow
> have a condition, checking the actual selected layout on the
> current page.

For the moment I solved it with a custom userFunc condition:

function user_page_layout($layout){

   $pageLayout = $GLOBALS['TSFE']->page['backend_layout'];

   if(!$pageLayout) {
     $cObj = t3lib_div::makeInstance('tslib_cObj');
     $pageLayout = $cObj->rootLineValue(99, 'backend_layout_next_level', 
1, $GLOBALS['TSFE']->tmpl->rootLine);
   }

   return ($layout == $pageLayout);
}

Regards,
Thomas




More information about the TYPO3-dev mailing list