1 reply [Last post]
ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 114
Was this information Helpful?

I am trying to get a list of images (with image cache) and title. Any one experience how to theme that? By default the accordion view module only allows one of the two (title or image) to be visible in the listed headers (that trigger the accordion effect when you click it). The development module's Themer info is not of much use since the accordion effect breaks it. I tried to create:

views-view-accordion--page.tpl.php:

<div class="item-list views-accordion <?php print $views_accordion_id ?>">
  <?php if (!empty($title)): ?>
    <h3 class="<?php print $views_accordion_id ?>"><?php print $title; ?></h3>
  <?php endif; ?>
  <div id="<?php print $views_accordion_id ?>">
    <?php foreach ($rows as $id => $row): ?>
      <div class="<?php print $classes[$id] ?>"><?php print $row ?></div>
    <?php endforeach; ?>
  </div>
</div>

But I don't know how to add the image cache image.

jrowny's picture
Offline
Joined: 01/08/2009
Juice: 297
Re: accordion view

You should be able to create a "fields" tpl.php and do it there using.

<?php
$fields
['whatever_the_imagecache_field_is_called']->content;
?>

Don't forget to rescan the template files.