0

I have created several views. These views have a block display. If I use these blocks in my template, the views are rendered with all the wrappers / divs. In my block template, can I alter the output of the "content" variable to get only the values? I tried to use different twig filters (striptags, trim, raw), without success. With these filters I get nothing.

Thanks.

1

1 Answer 1

0

A lot of templates are used to output a single Views display. It depends on your particular case which level you want to override. These templates are probably the best way to control the output of the views where ever you want to print them.

One template outputs the outer views divs, another is for particular format options, others are for controlling rows output. So you have to investigate and override the templates where you want to change the HTML for that particular view.

You can strip each individual Field of its wrapper and even field HTML in its Style settings directly in Views.

You can see the template suggestions under Theme: information in D7 Views, and in D8 you have to turn on the debugging mode to see the suggestions in page output.

Your Answer

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

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