tags:

views:

52

answers:

2

Let's say I have a view that returns some items. I want to display the items in an unordered list, so I rewrite the field output with <li>[field]</li>. Now I only have to surround the view with <ul>and </ul> tags.

However, when I add those tags as "full HTML" to the view's header and footer areas, they are being surrounded by a div like so:

<div class="view-header">
    <ul>
</div>

which kinda defeats the purpose, as the UL tag is ignored by some Browsers / jQuery versions.

How can I get rid of the divs around the <ul>?

+1  A: 

The answer is to override views-view.tpl.php so that instead of producing divs it only produces uls. Alright. Now I only have to find a template for views-view-fields.tpl.phpto override that as well.

winsmith
+2  A: 

For your concrete need, you can save yourself the trouble of overriding templates and just configure the view directly to use the style 'HTML List', with list type 'Unordered list'. (On the views configuration page, under 'Basic settings').

Henrik Opel
Thank you very much!
winsmith