开发者

How to surround a Drupal view with some tags?

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>?


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').


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜