Hello,
Is there a way for us to capitalize the properties in dropdown menu in advanced search page?
i tried Resource template but nothing changes.
Thanks,
Lu.
Hello,
Is there a way for us to capitalize the properties in dropdown menu in advanced search page?
i tried Resource template but nothing changes.
Thanks,
Lu.
Yeah, unfortunately some vocabularies like to give the “label” of their properties in this non-human-readable kind of format for some reason.
Templates are our usual way around this, but here they won’t currently do quite what you want… the code for handling a template when showing this property dropdown works this way, showing the original label, then the alternate label in parentheses like that.
So in this case, “Middle Name” is the alternate label in your template for the additionalName property, right? So would you want it to just say “Middle Name” for that property in the dropdown when you set the template in the site settings (and so on for all the other properties)?
Hi,
yes I would like to change the property label to “Middle name”. Would you suggest to go to the backend code and manipulate the dropdown menu to only show alternate label instead?
Thanks,
Lu
That’s certainly an option.
The file in question is application/src/Form/Element/PropertySelect.php, at or around line 58.
Replacing this
if ($altLabels) {
$valueOptions[$propertyId]['label'] = sprintf(
'%s (%s)',
$valueOptions[$propertyId]['label'],
implode(', ', $altLabels)
);
}
with
if ($altLabels) {
$valueOptions[$propertyId]['label'] = implode(', ', $altLabels);
}
will just show your alternate label(s) without the “original” label.
We’re thinking over whether to make this change in the core, whether just outright or behind a setting or something.