Hey,

I'm using panels 2, combined with (core) profile, to create a profile page for users; I'm then using views for field data ("Who I am", "Interests", etc.). The problem: if the user hasn't filled in corresponding data into whatever field then the corresponding label still shows. What method (.tpl.php?) could I use to make field labels disappear if the corresponding field data hasn't been inputted by the user?

Comments

pribeh’s picture

Ok, so I've been reading the view-theme literature but still am at a loss as to what php I'd use to make this happen. I'm not a php programmer yet and have only successfully implemented a profile.tpl.php so far - which I'm no longer using since implementing profile via panels 2.

This isn't an issue with panels 2, is it?

inforeto’s picture

There's several ways to modify the output of the views.

One way is by theming the view. Search for "theme views" for php examples.
Another way is that instead of inserting the view you use the views API to get a php array with the results and work with it.

It'd be easier if the view shows a single user profile, as it will be only one result to check. (one field per label)

pribeh’s picture

Thanks for your help. Alas, I'm not a php programmer. So I'll have to wait until I can get someone to help me program this.

dries arnolds’s picture

subscribing

catch’s picture

You don't need to know a lot of php to do this, it ought to be pretty much adding an if statement. Take a look at the handbook page to get started: http://drupal.org/node/109604

domesticat’s picture

Status: Active » Closed (fixed)

Performing a mass closing of all issues over 180 days old. Please reopen if needed.