Page 1 of 1

[SOLVED] CGUserDirectory Search form checkbox

Posted: Sun Jun 01, 2014 10:08 pm
by syreeni
Hi,

What would be the code for checkbox in Search Form Template?

There is only text and select as default:

Code: Select all

    {else if $data.fieldtype == 'select'}
      <select name="{$actionid}ud_propvalue[{$propname}]">
      {html_options options=$data.options}
      </select>

Re: CGUserDirectory Search form checkbox

Posted: Mon Jun 02, 2014 10:39 am
by Jo Morg
That is a Smarty function: http://www.smarty.net/docs/en/language. ... ptions.tpl and used to create dropdowns.
What are you trying to accomplish?

Re: CGUserDirectory Search form checkbox

Posted: Mon Jun 02, 2014 11:16 am
by syreeni
I've Frontend User Management module and there are 9 properties with checkbox. I need a Smarty checkbox code for CGUserDirectory search form.

It should be possible to search with them on different alternatives. I call it

{CGUserDirectory action="search" searchproperty="province,city,service1,service2,service3,service4,service5,service6,service7,service8,service9"}

Re: CGUserDirectory Search form checkbox

Posted: Mon Jun 02, 2014 12:10 pm
by Jo Morg
http://www.smarty.net/docs/en/language. ... kboxes.tpl
I didn't test it myself but it might work.

Code: Select all

{html_checkboxes name="{$actionid}ud_propvalue[{$propname}][]" options=$data.options}
Check the link for details on how to use it...

Re: CGUserDirectory Search form checkbox SOLVED

Posted: Mon Jun 02, 2014 9:25 pm
by syreeni

Code: Select all

{elseif $data.fieldtype == 'checkbox'}
<input type="checkbox" name="{$actionid}ud_propvalue[{$propname}]" value="1"/>