I have 3 fields in a view and I want to rewrite the output in a fourth field. like this


But I want to have a wrapper div around each field like in the field settings. The problem is I could do something like this:

<div class="mywrapper">
  <div class="field1">[field1]</div>
  <div class="field3">[field2]</div>
  <div class="field3">[field3]</div>
  <div class="field4">[field4]</div>

But with this even if the field is empty the divs with the css classes will stay alive. I dont want that. If the field is empty dont display it with the <div>.

If I just display the field, there are no wrappers at all.

  • I am not 100% sure but print $view or $output you will find the html wrappers as well. (check source code if wrappers are not visible on browser)
    – j2r
    Commented Feb 20, 2013 at 11:29

1 Answer 1


I found the answer myself. I use the modul views_fieldsets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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