Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The last couple of lines in views_plugin_row_node_cck_formatter.inc wraps the output inside a div
$output = '<div class="views-row-formatter-' . $formatter_name . '">';
$output .= $item_output;
$output .= '</div>';
My proposal is to remove that div. If the user wants to put a div around the content, he or she can do that in the appropriate Views template file, such as views-view-unformatted.tpl.php. However, if the user wants to remove it, it gets way harder. Why you wouldn't want a div there? In my case I'm outputing a <li>content</li> and the extra div outside it will break the ul-li behaviour.
Comments
Comment #1
ndeschildre CreditAttribution: ndeschildre commentedThe reason of this DIV is that only in the context of this View plugin can we insert a class indicating the type of CCK formatter you choosed to render the node. So it can't be done in views-view-unformatted.tpl.php or within another view template.
I agree it could be nice to let users remove it. I should add a theme() with my div by default, and then you can override this theme.
Meanwhile you can just put display:inline to this div, or other CSS rules that should make this work without any problem.
Comment #2
EmilOberg CreditAttribution: EmilOberg commentedYou're of course right about the theming. I was more thinking that it'd be a thing for the user to manually set, in lets say, views-view-unformatted--[viewname].tpl.php. But, as long as I get a theme(), I'm going to be one happy camper because I'll cry a bit if I've to do <ul><div><li> ;)
Comment #3
Dret CreditAttribution: Dret commentedA proposal to solve this problem.
I agree with Emil about the problem:
... creating an integration with "Semantic CCK" and inherit theming setting form there??