By dnguyen on
I'm assuming this requires some kind of overriding of the theme system...but basically, I want the list generated by the Views module (when you select View Type to be "List View") to be inline. The HTML such a view generates is:
<div class="content"><div class="view view-associated-art-creator"><div class="view-content view-content-associated-art-creator"><div class="item-list"><ul><li><div class="view-item view-item-associated-art-creator"><div class="view-field view-data-node-title"><a href="/node/2">Jennifer photo</a></div></div>
</li><li><div class="view-item view-item-associated-art-creator"><div class="view-field view-data-node-title"><a href="/node/5">Two Cats</a></div></div>
</li><li><div class="view-item view-item-associated-art-creator"><div class="view-field view-data-node-title"><a href="/node/1">Blue painting</a></div></div>
</li></ul></div></div><div class="more-link"><a href="/">more</a></div></div>
</div>
So no matter how I style the li and ul tags...The many div tags created by the Views module will cause a line break. How can I configure it so that it outputs span tags instead of div?
Comments
Have you tried styling the
Have you tried styling the div tags for this view with "display: inline"?
Actually, that does
Actually, that does work...and will do for a quick fix...but if I have a more complicated view-list, where several fields are listed, and thus more div tags created, that seems like it'll clutter the stylesheet fast. But maybe that ends up being less work than overriding a theme.
Set display:inline on the divs inside the li
A tip on what div's need to be formatted.
How about tables?
I decided maybe outputting the Views-block as a table would work better...so same kind of question...I want to theme the table so that for this particular view-block, I want a table consisting of one row and multiple columns (as opposed to the default multiple rows, single column layout)...Which function would I override?
cheap, inefficient hack
OK, I came up with my own hack, based on the following thread which discusses this in depth:
http://drupal.org/node/87367
Working off of this code, which I put in my template.php:
I wrote this, which doesn't use any theme calls. So it's basically a cheap hack that I can do while I learn the ins and outs of the theming system:
Hopes this help other Drupal learners.