1

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

[field1][field2][field3][field4]

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>
</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 Feb 20 '13 at 11:29
0

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, privacy policy and cookie policy

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