I'm trying to reduce the size of my views. They display images as a gallery and nest them in imagecache classes. I have managed to remove most of the unwanted code, but two parts remain problematic. Here is the code (part of the view with only one picture in row in this case):
<tr>
<td>
<div class="">
<div class="views-field-field-FIELDNAME">
<span class="field-content"><div class="">
<a href="/address"><img width="XYZ" height="XYZ" class="imagecache imagecache-XYZ imagecache-default imagecache-XYZ_default" title="TITLE TEXT" alt="ALT TEXT" src="XYZ.jpg"></a></div></span>
</div>
<div class="views-field-field-FIELDNAME">
<span class="field-content">
<div class="">
<a href="/address">TITLE</a></div></span>
</div>
</div>
</td>
</tr>
What I want to remove is the part
<div class="">
because it is empty and unecessary.
The second this I need to remove is are "a class" classes:
class="imagecache imagecache-XYZ imagecache-default imagecache-XYZ_default"
There are too many of them and I don't need any. If it is not possible, then I'd like to keep only one instead of 4 of them.
I guess it should be solved inside of content-field-...tpl.php, but I don't see any code there which could be deleted to remove these parts.
To remove the imagecache classes:
You can find the theme_imagecache_formatter_default() function in sites/all/modules/imagecache/imagecache.module .
You can override that, defining your own function, omitting the "$class" definitions.
There's a thread on Drupal.org about overriding theme_iamgecache_formatter_default that may be helpful.
As for the divs with empty classes: Are you using any views template overrides? I don't get that empty
<div class="">
code on my sites, which makes me wonder if you're modifying or overriding any of the Views templates. If so, you might try rolling back those changes to see if the empty-class divs disappear.