Page 1 of 2
[SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?
Posted: Tue Sep 22, 2009 9:30 am
by jack4ya
Using the CTLModulemaker gives a an option to create (dynamic) lists.
But whether you choose a dropdown list or a multiple select list, the search function outputs an multiple select list.
But I would like a single dropdown list.
So instead of multiple select list:
use this when I selected to create a single dropdown list:
I've tried looking in the template files, and the action files but no luck.
But it seems like a bug anyway?
What's the point then of having the option of selection the list type if it outputs the same?
Or have I interpreted this wrong?
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 9:43 am
by Loopy
I was just about to post the same thing. I've hit the same problem and haven't found a solution, any help would be great. ???
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 9:52 am
by jack4ya
Was thinking it might be a 'bug' but was not sure about submitting it.
Plger seems so busy already, don't want to burden him.
I've been looking for what generates the "size=3" or the "multiple" part of the generated code, as I could alter it then,
(I don't need multiple select list at all)...
I'll keep digging...
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 9:56 am
by Loopy
Trying to do the same here. I'll post if I have any luck.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 10:37 am
by jack4ya
I think I need to finetune my post.
It DOES give me a single dropdownlist in the backend for the editor.
It does NOT give a single dropdownlist in the frontend in the advanced search form for a websitevisitor.
I guess it's not really a bug then, but I would have expected the single dropdownlist ALSO to be used in the search form.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 10:40 am
by jack4ya
I think I'm on to something....
function.createFieldForm.php...
GOT IT
(but it's in the module, so everytime you need to alter it

but it least it gives as a hand)
Find:
CreateInputSelectList
your line looks something like:
Code: Select all
$output["whatever"] = array($this->Lang("parent_whatever"),$this->CreateInputSelectList($id,"field_whatever[]",$tmpoptions));
Apparently this generates part of the search form.
Change to
CreateInputDropdown
Code: Select all
$output["whatever"] = array($this->Lang("parent_whatever"),$this->CreateInputDropdown($id,"field_whatever[]",$tmpoptions));
it now outputs a (somewhat dirty) dropdown list.
I think in CTL MM the module outpur for function.createFieldForm.php needs to be altered from a CreateInputSelectList to a CreateInputDropdown. Only when a dropdownlist is selected in the backend of course.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 11:22 am
by jack4ya
Only problem is the droplist generates a:
Code: Select all
<option selected="selected" value=""/>
at the end of all values, causing the dropdown to start at the end... not so nice...
It must have something to do with the params ($tmpoptions ?) for the above mentioned line...
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 1:08 pm
by Loopy
jack4ya that work for me as well, thank you. Not the ideal but it will have to do. Now for that starting at the end problem, let the games begin, if I get anywhere I let you know. Thanks again.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 1:44 pm
by Loopy
In the file "function.createFieldForm.php."
there is a line:
just before:
Code: Select all
$output["whatever"] = array($this->Lang("parent_whatever"),$this->CreateInputSelectList($id,"field_whatever[]",$tmpoptions));
I deleted this for each dropdown list I have in that file and it seems display okay. Now all I need to do is get the result to display when I click the links my search returns. Hope this is of some help.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 2:41 pm
by jack4ya
Yay! Thanks. It all works for me now.
I quoted it out:
If a use my altered dropdown list to perform a search,
I get an listed result when I hit the search button.
And I can click it, then I'm taken to the detail page.
But for you it doesn't work?
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Tue Sep 22, 2009 3:55 pm
by Loopy
I don't know how or why but it's working now! Thanks again for the help on this.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Wed Sep 23, 2009 6:11 am
by jack4ya
Good to hear.
I guess we had luck we were working on the same thing at the same moment.
Thank you for your help also.
Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?
Posted: Wed Sep 23, 2009 10:35 am
by plger
Hi both of you.
I'm glab you've found a solution to your problem (you should add the [solved] to the topic). For reasons that I'm about to explain, this is not a bug, so I won't change it in the public module, but it's a good thing that there is a post on this that other users will be able to refer to...
The reason it's always a select in the search function is to allow a OR statements. For example, items normally have only one parent/category, but users may want to search withing two (or all except one, etc.) categories at the same time. They can do this with the multiple select.
Lastly, if you still want to have the empty option, you can maybe try to keep it and instead change:
$this->CreateInputDropdown($id,"field_whatever[]",$tmpoptions));
for
$this->CreateInputDropdown($id,"field_whatever[]",$tmpoptions,-1));
(untested, but I thought the default parameter might explain the initial selection)
Re: [SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?
Posted: Tue Sep 29, 2009 8:27 am
by jack4ya
Hi Plger,
Thanks for your response.
I still don't understand why you wanted the frontend user to be able to select multiple items in one list,
as where the backend user only gets to select one in the same list.
But it maybe beyond my scope.
I've pointed the developers to your module at the GeekMoot, I hope that was okay.
I think it's a really powerfull module

and I wanted to have them know about its existence.
Re: [SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?
Posted: Tue Sep 29, 2009 9:26 am
by plger
About the select list: let's say you're looking for jobs in your field (but you're a flexible guy and have experience in both Programming and Babysitting), and there's a module managing job ads. For each ad, there's a category, a location and a few other info. Now even though each ad has only one category and only one location, when you go to search you might want, for example, to search for "all jobs in Programming OR in Babysitting, that are located in Montreal OR Ottawa" (because you don't mind moving). With the select you can choose both categories and both locations, and you get results that fit any of the two.
About the GeekMoot, I'm glad you did (thanks), and I hope people will give as much feedback as possible! I would've liked to be there, I guess it was nice...