Trying to access contents of global content block inside UDT

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
bailiwick
New Member
New Member
Posts: 3
Joined: Thu Apr 04, 2019 7:44 pm

Trying to access contents of global content block inside UDT

Post by bailiwick »

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:

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\’}’);
*CMSMS Version 1.11.13

Would appreciate any guidance!
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1792
Joined: Wed Feb 25, 2009 4:25 am

Re: Trying to access contents of global content block inside

Post by DIGI3 »

Personally, I would upgrade to 2.x, use CGBetterForms for the form, and LISE to populate the dropdown. The way you're doing it sounds messy.
Not getting the answer you need? CMSMS support options
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Trying to access contents of global content block inside

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “CMSMS Core”