Page 1 of 1

global_content as dropdown

Posted: Mon Jul 21, 2014 6:43 am
by przemo
Hi,
I would like to give my clients the opportunity to choose htmlblobs from a selection list. I found this article:http://forum.cmsmadesimple.org/viewtopi ... own+global but it is not a perfect solution of my problem. I would like to dropdown list created dynamically (if client add htmlblobs or remove one the list will be automatically updated).
I use CMSMS 1.11.9 with AdvancedContnet and ECB modules.
The attached file shows what will be the perfect solution.
Anyone can help?

Re: global_content as dropdown

Posted: Mon Jul 21, 2014 8:39 am
by velden
try:

Create a User Defined Tag named 'GetGCBs'
$cms = cmsms();
$co = $cms->GetGlobalContentOperations();
$gcbs = $co->LoadHtmlBlobs();
$arr = array();
foreach ($gcbs as $gcb) {
$arr[$gcb->name] = $gcb->name;
}
return $arr;
In your page template use ECB:

Code: Select all

{content_module module="ECB" field="dropdown_from_udt" block="test2" label="GCB" udt="GetGCBs" assign="gcb" first_value="=select="}
           {if !empty($gcb)}{global_content name=$gcb}{/if}

Re: global_content as dropdown

Posted: Mon Jul 21, 2014 9:21 am
by przemo
This is exactly what I was looking for ::)
Thank you very much ~valden
Best regards!

Re: global_content as dropdown

Posted: Wed Jul 23, 2014 11:22 pm
by applejack
Or you could just use TinyMCE and choose which GCB you want the user to have access to.