Search dropdowns instead of checkboxes
Permalink Browser Info Environment
Is there any way of displaying Employment Type and Locations as dropdowns rather than checkboxes.
Employment Category is already a dropdown and I cant find any options to display any differently.
Thanks.
Employment Category is already a dropdown and I cant find any options to display any differently.
Thanks.
Type: | Discussion |
---|---|
Status: | New |
by default it will just use whatever default concrete5 core form interface for whatever the given attribute type is. So to override this behavior you'd have to do a little customization, but it really shouldn't be hard to get this behavior if you know a little php. Take a look within the jobs search block view.php to see where that's being outputted, and try adding a conditional statement checking the handle of the attribute type. There may even already be an example there of doing something similar for some other attributes.
I don't imagine that you still need this, but anyway.
In our view, under Tony's code at the beginning of the file, we added:
Later on, in the form, we display them like this:
PM me if you need anything else.
In our view, under Tony's code at the beginning of the file, we added:
$category_attrKey = CollectionAttributeKey::getByHandle( 'employment_category' ); $category_opts = $category_attrKey->getController()->getOptions()->getOptions();
Later on, in the form, we display them like this:
<select name="akID[17][atSelectOptionID][]" data-dkid="dkid3" class="pretty dk" tabindex="2" style="display: none;"> <option selected="selected"><?php echo t('Employment Category'); ?></option> <?php foreach ($category_opts as $opt): ?> <option value="<?php echo $opt->getSelectAttributeOptionID(); ; ?>"><?php echo t($opt->value); ?></option> <?php endforeach; ?> </select>
PM me if you need anything else.