Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am using the views php module and want a custom label.

The label field doesn't allow php to be entered, how would I go about changing the label?

share|improve this question
1  
Could you explain why do you feel you need a PHP code there? –  Mołot Aug 23 at 13:39
 
It is a table that shows data for 12 weeks. Each column should have that weeks date displayed as the label –  Josh Aug 23 at 13:40
 
Hello again :) Remember, on this site it is always better to edit your question than to comment. It's not a forum and most people will not read comments before judging if your problem is worth their time and effort. –  Mołot Aug 23 at 13:43

1 Answer

In the view UI, choose a php field type

enter image description here

and your custom php code can be entered here:

enter image description here

share|improve this answer
 
But how do I put php in the label field? –  Josh Aug 23 at 14:37
 
You can't. Php is for each row. The label is a single value for the column's title. Your column's title has the be unique for your view, what iss changing is the rows no ? –  pico34 Aug 23 at 14:41
 
I need the label to change based on the date selected to display the proper week as the label –  Josh Aug 23 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.