Page 1 of 1

Company Directory - Dropdown selector ?

Posted: Wed Mar 11, 2015 5:08 pm
by naturelab
I am building a site, where each page can be 'sponsored' by a local business.

ie: I want to say "This page, sponsred by this business" and have an easy way for a user to select and change the selection for the business.

The companies are set up using the Company Directory module.

I want to have a dropdown selector in the page admin area populated with each company name.

Is this possible ? Do I have to use CGContent Utils with a UDT to generate the dropdown ?

I have never used this module and am struggling to integrate anything into the *page admin area*



Any pointers ? Thankyou.

Re: Company Directory - Dropdown selector ?

Posted: Thu Mar 12, 2015 8:43 am
by naturelab
...from the lack of mention of this on the forums ( and believe me, I have trawled them extensively ), I am approaching this from COMPLETELY the wrong direction.

All I want to do, is associate a particular page, with a specific company entry.

Maybe I do this through the Company Directory admin panel ?

Any pointers ?

Re: Company Directory - Dropdown selector ?

Posted: Thu Mar 12, 2015 11:10 am
by velden
I think using ECB or CG Content Utils combined with a UDT indeed is the way to go. But I don't know if it's easy to write that UDT. I never used the CD module myself.

Re: Company Directory - Dropdown selector ?

Posted: Thu Mar 12, 2015 3:36 pm
by naturelab
OK, thanks for the reply.

Trying to do something like this :- ( UDT which gets Galleries from the Gallery module )

Code: Select all

if(!cms_utils::get_module('Gallery'))
return;
 
$galleries = Gallery_utils::GetGalleries();
$ret = array();
if($galleries){
foreach($galleries as $gallery){
$gpath = ltrim($gallery['filepath'] . $gallery['filename'], '/');
$ret[($gpath ? $gpath : $gallery['title'])] = $gpath ? $gpath : '/';
}
}
return $ret; 
Unfortunately, I can't find anythging suitable in class.cd_utils.php that will do a similar job ??? , but I will keep looking.