[SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

[SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?

Post 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?
Last edited by jack4ya on Thu Sep 24, 2009 9:18 am, edited 1 time in total.
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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.  ???
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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...
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post by Loopy »

Trying to do the same here. I'll post if I have any luck.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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.
Last edited by jack4ya on Tue Sep 22, 2009 10:54 am, edited 1 time in total.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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...
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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.
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post by Loopy »

In the file "function.createFieldForm.php."

there is a line:

Code: Select all

$tmpoptions[""] = "";
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.
Last edited by Loopy on Tue Sep 22, 2009 1:46 pm, edited 1 time in total.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post by jack4ya »

Yay! Thanks. It all works for me now.
I quoted it out:

Code: Select all

/*	$tmpoptions[""] = "";	*/
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?
Last edited by jack4ya on Tue Sep 22, 2009 2:45 pm, edited 1 time in total.
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post by Loopy »

I don't know how or why but it's working now! Thanks again for the help on this.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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.
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: CTLModulemaker - outputted dropdownlist/multipleselectlist seems the same?

Post 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)
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: [SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?

Post 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  ;D and I wanted to have them know about its existence.
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: [SOLVED] CTLModulemaker - outputted dropdownlist/multipleselectlist the same?

Post 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...
Post Reply

Return to “Modules/Add-Ons”