Trying to access contents of global content block inside UDT
Posted: Thu Apr 04, 2019 7:57 pm
I have a global content block (basically contains a select element with options which I'd like to be able to change from one location but need to appear throughout my site in various forms) and I'd like to be able to include its content inside one of my forms which is currently created within a UDT.
I searched forums and found something that looked promising but which (after trying to use on my site*) causes my page template to break:
*CMSMS Version 1.11.13
Would appreciate any guidance!
I searched forums and found something that looked promising but which (after trying to use on my site*) causes my page template to break:
Code: Select all
$gCms = cmsms();
$modules = array_keys($gCms->modules);
$modObj = $gCms->modules[$modules[0]]['object'];
//following line kills page
$selItems = $modObj->ProcessTemplateFromData(‘{global_content name=\’mygcbname\’}’);
Would appreciate any guidance!