By ipswitch on
I've found several posts dealing with this issue, mostly focused on removing the colon if the label end with a "?".
http://jaspan.com/removing-unwanted-colons-form-field-titles
http://www.lullabot.com/articles/what_if_a_field_title_ends_with_a_quest...
And I found this page - http://drupal.org/node/293908 - that provides a template.tpl.php function for removing the colon from all labels (which btw, didn't work for me).
Has anybody figured out a way to customize the colon display based on the content type?
I thought it would be easy, but after several hours, I still haven't gotten anywhere.
thanks
Comments
removing colon after cck field label
I have tried all of the references you gave above and none of them have worked for me. I am using drupal 6 with a modified frameworks theme .
Did you ever come up with a solution?
still working on it
this seems so simple. sure it's usually nice to have the colon but when you don't need it, it seems to be impossible to hide. If I find a solution, I will post it here.
removing colon from form label by modifying includes/form.inc
I tried the the function meier_form_element method http://drupal.org/node/293908 but it does not remove the colons on the webform
I created a custom theme named "meier" from framework too, and renamed the theme directory and info file and info file info:
and the function phptemplate_form_element() method http://jaspan.com/removing-unwanted-colons-form-field-titles does not work either
the only way I can remove the colons is by hacking the core, includes/form.inc and removing the colons from
$t('!title:to make them$t('!titlein function theme_form_element lines 2202 and 2205I tried copying this exact function to the template.php in my theme and renaming it meier_form_element and no luck :(
~are you netsperienced?
♥ follow me @decibelplaces ∞
finally got it to work for all labels
save the below code as "content-field.tpl.php" and drop it in your theme folder. Works for me and no need to hack core.
doesn't work for me to remove colons from webform labels
I created the file and put it in my theme - which is a custom adaptation of the framework theme
I also replaced the hacked includes/form.inc with a fresh copy
nothing happened
I tried including "content-field.tpl.php" in the theme template file and got an error:
I think it is because the code provided is designed to remove the colon from content-fields but not from form fields
So when I upgraded to core 6.11 I lost my hacked form.inc file
I devised a DHTML method to remove the colons from webform labels http://drupal.org/node/293908/1540580
~are you netsperienced?
♥ follow me @decibelplaces ∞
Here is my fix
I like this because it leaves in the colon wherever it is supposed to be, but if for example I end a field with a ? it removes the colon on the fly so I don't end up with a ?: and I don't have to remember to add colons everywhere because I removed them entirely (but should I forget the script is smart enough to know I don't want a :: - comes in handy
If you want to make it smarter just expand the switch statement. -peace (don't forget to rename the 'theme' with your theme or you will get errors!
This copy paste this code at the end of your template.php file in your theme's directory
PHP template vs DHTML - and lable vs label
this looks like a good approach, with nice flexibility
you need to remember to re-add it to your template if you update the theme to a new version
using DHTML code in a block does not get affected by an update
like most things on computers, there are many ways to do this
also, because I suffer from "pforp": I want to point out that "label" is spelled with an "el" (however "ladle" is not)
~are you netsperienced?
♥ follow me @decibelplaces ∞
lol - thanks
yeah - that english get pretty tricky sometime :)
Thanks!
:)
Thank you for the code. Works
Thank you for the code. Works for me...
Im getting a fatal error when
Im getting a fatal error when using in my zen template.php, any suggestions?
Worked perfectly, thanks!
That worked great for me, thanks for the info!
This simple solution
This simple solution suggested by iko worked for me. In Views | Fields:
mylabel... [field_my_cck_field_name_token]D7
Copied the field.tpl into my custom template directory. Removed the colon from the label definition:
from
php print $label ?>:
to
php print $label ?>
Couldn't have been any easier.
Simple and effective, thanks.
Simple and effective, thanks.
Hi, I've made the same thing:
Hi, I've made the same thing: removed the colon from the label definition, and then copied field.tpl into themes/templates directory but it didn't work...
I think I've missed something...
No colons module
Just give a try to the No Colons module, worked perfectly for me:
http://drupal.org/project/no_colons
Remove colon from CCK field label
This solution works if the field was created by CCK. Using Drupal 6.28 and CCK 2.9
Copied /sites/all/modules/cck/theme/content-field.tpl.php into my theme folder, /sites/all/themes/[theme-name]/content-field.tpl.php
Edited the content-field.tpl.php in my theme folder, Removed the colon from line 31 & 40
If you only want to remove the colon on specific fields you can do this:
Copy the content-field.tpl.php into your theme folder
Duplicate content-field.tpl.php and rename this one: content-field-[field_name].tpl.php, ex. content-field-field_project.tpl.php
- make sure to have both files in your theme folder or it wont work.
Reference: http://drupal.org/node/269319