This view is a black book directory that will have a long list of links to static pages. The problem I am having is the output isn't coming out as an unordered list like I have set. Each link is set in a span and a row. Is it possible to output a simple ul with an id on it. I am having trouble matching my design. Thanks
Drupal likes to put
<div> around every item. When you don't like that, you can override the PHP file that's causing this.
Look in the
sites/all/modules/views/theme folder at the
Save a copy of these files in your own theme's 'templates' folder. Then you can edit the copies to strip code that makes
<div> etc. You should also rename your version of these files according to the view's template suggestions so the changes only affect your view.
I used this for a view where I wanted to make 3 columns, so I wanted the classes li_1, li_2 and li_3 (in file
<?php // $Id: views-view-list.tpl.php,v 1.3 2008/09/30 19:47:11 merlinofchaos Exp $ /** * @file views-view-list.tpl.php * Default simple view template to display a list of rows. * * - $title : The title of this group of rows. May be empty. * - $options['type'] will either be ul or ol. * @ingroup views_templates */ global $cnt_ul; global $cnt_li; $cnt_ul++; $classNameUl = (($cnt_ul % 3) == 0)? "ul_". $cnt_ul ." last" : "ul_". $cnt_ul; ?> <ul class="<?php print $classNameUl ?>"> <?php foreach ($rows as $id => $row): $cnt_li++; $className = (($cnt_li % 3) == 0)? "li_". $cnt_li ." last" : "li_". $cnt_li; ?> <li class="<?php print $className ?>"><?php print $row; ?></li> <?php endforeach; ?> </ul>
You should also take a look at the Semantic Views module, which allows you to change the HTML output of the view from within the Views UI and largely avoid getting involved in template files.