Link to home
Start Free TrialLog in
Avatar of jiiins2
jiiins2

asked on

Drupal 6: Unable to retrieve field's value in view

I'm new to Drupal and I just inherited from a developer a content profile form with several fields (used as registration form). I added a few fields but I can't retrieve their values in a views, while the older ones show up correctly. The following for example prints nothing:

<?php print $fields['field_membership_type'] ?>

Open in new window


In the views, I even set the above filed to be set to "xxxx" if empty, but still nothing gets through.

There are no typos and permissions look right (identical to the old fields), so I'm out of ideas...

Thanks
Avatar of oliverpolden
oliverpolden
Flag of United Kingdom of Great Britain and Northern Ireland image

First of all make sure you are editing the correct file and that the output isn't being cached.
Edit the file to put '#' or something identifiable outside the <?php ?> tags.  Clear your cache and check you can see your change. If you can't see your change, then you're probably editing the wrong file. (where is the file you are editing and what is it called?)
That may solve your problem (by clearing the cache).
Next, you will need to edit the view to add the extra fields you want.
Avatar of jiiins2
jiiins2

ASKER

Unfortunately i already tried all of the above. I get only my two ## as print out...
ASKER CERTIFIED SOLUTION
Avatar of oliverpolden
oliverpolden
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jiiins2

ASKER

I did the print_r and it shows the new fields as empty. The old fields are printing out just fine without the [0]. How can I pass you the login safely?
oliver@e3m.co.uk
Avatar of jiiins2

ASKER

on its way
Avatar of jiiins2

ASKER

Got it:

<?php print $fields['field_membership_type_value']->content ; ?>

Open in new window