Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Minor change if someone could point in the right direction.
In Views all my other CCK fields exposed filters have in drop down But my Year seems to have "-Year" in it instead of
I would like to be able to change the label from "-Year" to "" to match all my other filters.
Tried using the stringoverrides to replace the -Year with but i assume this "-Year" is not being processed using t()
Any Ideas would be greatly appreciated!
Thanks
Comment | File | Size | Author |
---|---|---|---|
#2 | date_default_label.patch | 1.35 KB | julien |
Comments
Comment #1
julien CreditAttribution: julien commentedFound a way to do it. You can edit date_api_elements.inc line 219 and add :
$element['year']['#options'][''] = 'your string';
Could be nice to have a variable_get instead of 'your string' to define it somewhere.
Hope that helps
Comment #2
julien CreditAttribution: julien commentedHere is a quick patch to fix this.
Comment #3
drupalfan79 CreditAttribution: drupalfan79 commented@julien, how to do this in version 7.x-2.7
Comment #4
julien CreditAttribution: julien commentedLooking at this new version code, maybe you can try to use this theme function in template.php of your theme, see if it works. Haven't tested so i'm not too sure. Check if you can alter the element variable maybe.
Comment #5
jerrylow CreditAttribution: jerrylow commentedSo I was looking into this myself for 7.x 2.x-dev and found this.
Look into module/date/date_api/theme/theme.inc and you'll find starting at line 104 the functions that generates the starting date label. Such as
So basically I copied that function into my template.php as so:
And it works great.
Comment #6
julien CreditAttribution: julien commented@jerrylow, thanks for that, indeed it's better using this than my solution.
Comment #7
DamienMcKenna