(Solved) CGContentUtils Droprownlist

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
idorroc
New Member
New Member
Posts: 2
Joined: Wed Feb 17, 2016 10:22 am

(Solved) CGContentUtils Droprownlist

Post by idorroc »

I try to get a simple Dropdownselector for galleries in the backend. With CGContentUtils i can get the Dropdownlist. But i get no value in the frontend.

{content_module module='CGContentUtils' block='testdropdown' label='Gallerieauswahl 2' value='RC' name='testdropdown' assign='inhgall2'}

{if !empty($inhgall2)}{Gallery dir=$inhgall2}{else}<h1>{eval var=$inhgall2}*{$inhgall2}</h1>{/if}

I just get the "*"
What can be wrong?

CMSMS 2.1.2
AdminSearch 1.0
CGContentUtils 2.1
CGExtensions 1.51.1
CGSimpleSmarty 2.0.5
CMSContentManager 1.1
CMSMailer 6.2.14
DesignManager 1.1.1
FileManager 1.5.2
FormBuilder 0.8.1.3
Gallery 2.1
JMFilePicker 1.0
LISE 1.1
MenuManager 1.50.2
MicroTiny 2.0.3
ModuleManager 2.0.2
Navigator 1.0.2
News 2.50.4
Search 1.50.2
Last edited by idorroc on Wed Feb 17, 2016 2:51 pm, edited 1 time in total.
idorroc
New Member
New Member
Posts: 2
Joined: Wed Feb 17, 2016 10:22 am

Re: CGContentUtils Droprownlist

Post by idorroc »

Ok solved. It was this scope thing >:(
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 173
Joined: Fri Feb 06, 2009 2:08 pm

Re: CGContentUtils Droprownlist

Post by PinkElephant »

Hi idorroc

I'm currently puzzling over the same task in 2.1.2 so would you mind sharing exactly how you set this up?

(I'm falling at the first hurdle where even the UDT for CGContentUtils 'Dropdown from UDT' doesn't seem to be working...)
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 173
Joined: Fri Feb 06, 2009 2:08 pm

Re: CGContentUtils Droprownlist

Post by PinkElephant »

It turns out that I should have paid more attention to the logs -- I was using a test page with 'other issues'.

In case it's of any use elsewhere, this UDT did the trick;

Code: Select all

// UDT: gallery_list
// return array of Gallery directories (can be used with CGContentUtils dropdown)

// DEBUG
// return array("A" => "First entry", "B" => "Second entry", "C" => "Third entry");

$galleryArray = array();

// returns empty array if the module doesn't exist
$mod = cms_utils::get_module('Gallery');
if (! is_null($mod)) {
    $galleries = Gallery_utils::GetGalleries();
    foreach ($galleries as $gallery) {
        // exclude the root gallery (with no filename)
        // to exclude galleries with no (active) images, test for $numimages 
        if ($gallery['filename'] != "") {
            $gallery_dir = $gallery['filepath'] . rtrim($gallery['filename'], '/');
            $galleryArray[$gallery_dir] = $gallery_dir;
       }
    }
}

return $galleryArray;
Post Reply

Return to “Modules/Add-Ons”