my problem is that my captcha and T&C modules are appearing between form fields in user registration page, instead of at the end of the page. I am also using content profile module. In firebug i edited the html.js and it was fine but i dont where that html laying in Drupal 6. I also tried to install DEVEL module but couldn't install it because some problem with zend optimizer. anyway can any one tell me how to reorder form fields and modules at the backend.

Comments

mm167’s picture

i don't have a full picture of your case. but may be, u can resolve the issue by adjusting the weights.

otherwise, as this is a theming issue, u may need to modify the xxxx.tpl.php.

kaay’s picture

thanks for the reply to be honest it didn't help. I would like to post screenshot but i don't see any link here to attach. it would be nice if you can tell where and what i have to change to achieve my goal, as i have already mentioned that i am using following modules on the user registration:
1) content profile
2) Captach
3) Terms of use

kaay’s picture

helloooo!!

yasir farooqui’s picture

You can do this by overriding the form layout in you theme. You need to get the form id of your registration form and will need to do some thing like this in the template.php file of your theme:-

function yourtheme_theme() {
   return array(
     // The form ID.
     'user_register' => array(
       // Forms always take the form argument.
       'arguments' => array('form' => NULL),
     ),
	
   );
}

then write following function....

function yourtheme_user_register($form)
{
	$output='';
	$form['User Info']['profile_firstname']['#weight']=10; 
	$output=drupal_render($form);
	return $output;
}

note that you will need to access the field like I did for profile_firstname field here... and set the weight accordingly.

Thanks

kaay’s picture

thanks for the reply. I have two question cause its not working
1) do I have to put both block of codes in template.php ? if yes then i am doing the same.
2) What is ['User Info'] in second block of code because I am replacing ['profile_firstname'] with my field name in it and ['#weight']=10; to my required weight.

yasir farooqui’s picture

Yes all the code will go in template.php file, and "User Info" is the group of profile in which your profile fields are. Also do not forget to clear drupal cache after doing this.

kaay’s picture

Hi Yasir, thanks for the reply but its not working i have updated cache and theme but no effect. what you sugguest?

yasir farooqui’s picture

what did you replace "User Info" with?

kaay’s picture

User Info, i didn't replace with any thing what should I replace with?

yasir farooqui’s picture

There is a category for each profile field when add that field, you need to replace "User Info" with that category value for the fields you want a rearrange....

kaay’s picture

so how to find those categories? do i need to use firebug? i didn't create any category so i don't know is there anyway to find those categories. thanks for the reply

yasir farooqui’s picture

Well... edit one of your profile field... there you will see a text field on the top with label "Category", type any thing there, and save, now your profile field will be in that category...

kaay’s picture

there isn't any label "CATEGORY" in edit field. infact there are follwoing text fields available if you click on field confg. or create new field :
LABEL
WIDGET TYPE
HELP TEXT
MAXIMUM LENGTH
ALLOWED VALUE LIST but not category label

and if you click on CHANGE BASIC INFORMATION THEN;

FIELD NAME
LABEL
FIELD TYPE
WEDGET TYPE but not category label

I hope you are aware that I am using drupal 6 and content profile module to extend the registration form. Thanks

yasir farooqui’s picture

Sorry for all the confusion so far... I was thinking that you are using Profile module so far. But even in that case it should not make much difference, except that you will have to trace the field with in $form object. You can do this by printing that variable on screen and debug that how you can access your profile field with that variable, rest all will be same...