I created a view (page name 'Archives') to load the following values from all the posts of a particular content type.
Year = field_year
Volume = field_volume
Issue = field_issue
By using views I couldn't get the desired output. So, I created a template file (views-view--archives--page.tpl.php) and wrote the following code. Please see the attached screenshot & code below. Please help me in correcting the code. This would be a great help. Thanks
<ul>
<?php foreach ($view->style_plugin->rendered_fields as $delta => $item): ?>
<li>
<span class="view-header"><?php print $item['field_year']." (volume - ".$item['field_volume'].")"; ?></span>
<span class="view-issues"><?php print "Issue ".$item['field_issue']; ?></span>
</li>
<?php endforeach; ?>
</ul>
page--archives.tpl.php
will be used to create the overall page structure when you gotowww.example.com/archives
, so the output of your view will be placed in the content area/region in the page. Are you needing the Year field somewhere else on that page? If so where and in what format, eg rendered or raw or?