Using profile module, I have set up a number of fields for users address details. Eg. House no., Address line 1, Address line 2 and so on. They are all private, and so each displays "The content of this field is kept private and will not be shown publicly." underneath.
This looks a bit ridiculous from a design point of view. I would like to remove all these notices and replace them with one right at the top which says "The content of this SECTION is kept private and will not be shown publicly." This makes more sense, right?
Can anyone help out? I have already got a user_register.tpl.php but all it does is print_r(drupal_render($form) - I need to find out how to customize the form itself.
Thanks
Comments
Already a solution? I've the
Already a solution? I've the same problem with making a Terms of Agreement.
Solved...
OK...I am sure the hardcore drupalers could have done this better ... but here is an easy fix I just implemented for this.
Step 1: Intercept the user-registration form & pass it to a template by adding the following to template.php:
Step 2: Create a user-register.tpl.php file with the following that strips the unwanted text:
Workaround for D6
I followed instructions here to add a template.php
function yourtheme_theme
(note - you can add lines to this function if it already exists) andfunction yourtheme_preprocess_user_register
and then I put the following inuser-register.tpl.php
The easier method...
Just search for this string in the translations page. You can replace the string with a blank space to override it.
Look ma' ... no code!
Another solution
Hello!
I ran into this problem today, and unfortunately, none of your suggestions work (I am simply running the chameleon theme which does not have its own template.php file to begin with), and the line doesn't exist in any of my translation files!!
After spending 2.5 hours, I finally found an easy solution, which is stated below.
A quick note before I head into my solution: the reason this "stupid" line keeps appearing for every profile field I define is that I select:
Visibility: Private field, content only available to privileged users.
which is exactly what I need for my community. As I don't want to share users' details publicly. If I select the other option (there is a total of 4 options): Public field, content shown on profile page and on member list pages. - that line won't show up, but its not what I want functionality wise.
Here is my simple solution:
Go to:
htdocs>modules>profile>profile.module
scroll down to (approximately line #341): where you see:
if ($field->visibility == PROFILE_PRIVATE) {
$output .= ' '. t('The content of this field is kept private and will not be shown publicly.');
}
and simply remove the text between ' '.
I personally did not delete it -just in case I might need to bring it back in future, so I just cut it from the line and pasted it into a comment that I attached below.
There! Phew!
Oh - and Ryan: no code here either ;-)
That most certainly is code
That most certainly is code that you're messing with, and it's core code at that. Every time Drupal is updated, that fix needs to be reapplied.
Better to use translation, or strings override, or template.php, to deal with it.
String Overrides module
String Overrides module worked well for me.
String overrides
exactly
String Overrides
That's a neat module - This worked great for me, always reluctant to start editing code.
Slightly concerned about performance if used a lot on a big site, but hopefully the caching will take care of this. Either way not an issue for the site i used it on.
Another great module showing the flexibility of Drupal.
String Overrides module
Would you mind giving some instructions?, I have the module installed, and I have fed the string [text only], and what I want to appear in stead. but it does not work, where should I be copying the content to override?, should it have some sort of code in it versus me just using the text?
These are the string I want to change to my own as they appear in the "Register" form:
"Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores."
"A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."
"The content of this field is kept private and will not be shown publicly."
"The content of this field is kept private and will not be shown publicly."
"The content of this field is kept private and will not be shown publicly."
Thanks !
t('The content of this field
@MrMelson
For multilingual sites if I'm not mistaken
________________
Live fast die young
The same effect with hook
1. Create new module
2. Inside NAME.module put
It will remove unwanted string from all profile_* fields.
Cheers,
Jan