Hello,

I would like to wrap a link to the corresponding node around the $row variable displaying my teaser in views-view-list.tpl.php. I have a hidden div with grouped fields utilizing Field Group module that I am displaying using Jquery hover. It is currently nested within the <li> </li>. Since $node_url is not available as a variable in views how would I accomplish this?

Here is the template file:

<?php
/**
 * @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
 */
?>
<?php print $wrapper_prefix; ?>
  <?php if (!empty($title)) : ?>
    <h3><?php print $title; ?></h3>
  <?php endif; ?>
  <?php print $list_type_prefix; ?>
    <?php foreach ($rows as $id => $row): ?>
      <li class="<?php print $classes_array[$id]; ?>">
	
	  <?php print $row; ?> 
	  </li>
      
   
	<?php endforeach; ?>
  <?php print $list_type_suffix; ?>
<?php print $wrapper_suffix; ?>

What I need:

<li class="<?php print $classes_array[$id]; ?>">
	<a href="LINK_TO_NODE">
	  <?php print $row; ?> 
</a>
	  </li>

Thank you for the help.

Comments

alexander.sibert’s picture

I need the same solution i mean i need the url as token.

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)