global_content as dropdown

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

global_content as dropdown

Post 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?
Attachments
cmsms.jpg
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: global_content as dropdown

Post 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}
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

Re: global_content as dropdown

Post by przemo »

This is exactly what I was looking for ::)
Thank you very much ~valden
Best regards!
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: global_content as dropdown

Post by applejack »

Or you could just use TinyMCE and choose which GCB you want the user to have access to.
Post Reply

Return to “Modules/Add-Ons”