Closed (fixed)
Project:
Views (for Drupal 7)
Version:
4.7.x-1.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 May 2007 at 07:35 UTC
Updated:
26 Aug 2008 at 06:15 UTC
How to get a node path when I try to theme a "List View".
I'm using the following code get node path in views-list-myview.tpl.php
$n = node_load($node->nid);
$path = $n->path;
This works when logged in to my site as an authenticated user. But the $path variable is blank for non-authenticated users .
How to get a node path variable that can work for both non-authenticated users and authenticated users? Thanks!
Comments
Comment #1
kuldip zala commentedfirst
$node = node_load($nid)
then
$path = drupal_get_path_alias('node/'.$node->nid);
OR
$path = drupal_get_path_alias('node/'.$nid);
Comment #2
merlinofchaos commentedComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.