I am very new in Drupal. I am using Drupal 7. I would like to create a custom rendering for a view I have created. Thanks to many posts found on the internet I have already done the following steps:
- Created a content type with Title and URL (it simulate a link list)
- Added 4 items of this content type
- Created a view which return items of my content type unsorted
- Thanks to the Theme Information link I have created a template named
views-view--xxxx--page.tpl.phpwhere xxxx is the name of my view. - I have added the following code to the TPL file
<article id="node-123456"> <header> <h1>Sample Title</h1> </header> <div class="content"> </div> <footer> </footer> </article>
And this works perfectly because I am seeing the Sample Title text when navigating on the page. I want now to enumerate the list of content item produced by the view but I dont know how to enumerate them. I have tried with
<ul> <?php foreach ($rows as $id => $row): ?> <li><?php print $view->render_field('field_url', $id);?></li> <?php endforeach; ?> </ul>