Hi all!
I'm fairly new to cmsms and I'm trying to make my way around, without great success.
I'm looking for a way to implement a country selector in my FEU user property form.
First, I created a select field in my User Properties. Since there's a country table in my database, I also created a {countrylist} User Defined Tag to query the database and generate the options to my select field. Tho, when i put it my {countrylist} smarty tag inside my option list, it shows {countrylist} as a string, not as a smarty tag.
Is there a way inside the option list to force the use of smarty tag?
Thanks alot for your time.
FEU - country selector
Re: FEU - country selector
You will need eval function for that field in your FEU Template.
http://www.smarty.net/docs/en/language. ... n.eval.tpl
http://www.smarty.net/docs/en/language. ... n.eval.tpl
Re: FEU - country selector
thanks for your reply uniqu3. It led me on a solution but I'm still having trouble. Here's what I done so far:
-created my User Properties:
-afterward, created my field in FEU user property:
it's a dropdown list in I grabbed my User Property {countrylist} as my option.
-lastly, I modified my form template:
I change {$control->control} to {eval var=$control->control}
No, what happens is that my options in my country dropbox looks like this:
<option value="<option value="1">Afghanistan</option>[... up to ...]<option value="238">Zimbabwe</option>">
<option value="1">Afghanistan</option>[.... up to ....]<option value="238">Zimbabwe</option>
any ideas to prevent dupicating?
-created my User Properties:
Code: Select all
global $gCms;
$db =& $gCms->GetDB();
$sql = 'SELECT * FROM cms_module_cge_countries ORDER BY name';
$r = $db->Execute($sql);
$results = $r->GetRows();
if ($r) {
foreach($results as $key => $value)
{
echo '<option value="'.$value['id'].'">'.$value['name'].'</option>';
[b]// tried echo $value['name'].'='.$value['id']."\r\n"; but it created a singlew option will all my countries in it.[/b]
}
} else {
echo 'query failed';
}
it's a dropdown list in I grabbed my User Property {countrylist} as my option.
-lastly, I modified my form template:
I change {$control->control} to {eval var=$control->control}
No, what happens is that my options in my country dropbox looks like this:
<option value="<option value="1">Afghanistan</option>[... up to ...]<option value="238">Zimbabwe</option>">
<option value="1">Afghanistan</option>[.... up to ....]<option value="238">Zimbabwe</option>
any ideas to prevent dupicating?