By beekerstudios on
I have a custom node view that I have created to provide a list view for a streaming video gallery/podcast listing. The problem is that the $node->path only displays when I am logged in, so anonymous users don't actually get a link to the headsup of the video. Am I doing something wrong?
$node = node_load($node->nid);
//now we add the stylesheet...
drupal_add_css(path_to_theme() .'/views-list-frontpage.css');
print $node->path "> print $node->title
print $node->teaser
Comments
Whoops!
Here is the code again
Use $node_url instead of
Use $node_url instead of $node->path
José San Martin
http://www.verinco.com/
José San Martin
http://www.chuva-inc.com/
Doesn't work at all
Putting $node_url doesn't work at all. I think this may be because I am grabbing the whole node and putting in $node. This was done per a cookbook article.
I tried:
$node->url
$node->node_url
$node->path (of course only admin can see that)
When I do a print_r($node); I don't see the path attribute in the array for an anonymous user, but I do for an admin or logged in user. What's the deal? Is this a permissions issue?
This is Drupal 5, I don't know if views is different on 4.7.
Sorry I didn't answer it
Sorry I didn't answer it later.
(you're using Drupal 5, right?)
$node->url and $node->node_url doesn't exist.
$node->path only works when someone with editing permission is logged. I'm not sure why, but I have already read a good explanation on that.
$node_url works in node.tpl.php. Can't you put it there?
What are you theming, after all? Is it a front-page view? Is it a node page? Is it a completely different thing?
Regards,
José San Martin
José San Martin
http://www.chuva-inc.com/
It's a list view, it's
It's a list view, it's pretty simple, but instead of attaching an image, I am just using a field I already set, and ftp the images by hand. I am using Drupal 5.1. Here is the contents of the view:
In template.php I have this:
Oh! Well, in the "Edit View"
Oh!
Well, in the "Edit View" page, add a field named "Link to Node" and theme it.
I think it is enough.
José San Martin
http://www.verinco.com/
José San Martin
http://www.chuva-inc.com/
Looks like the path.module is broke!
http://drupal.org/node/66642
In /modules/path/path.module I had to replace:
With this:
not broken!
Be careful with what you change in core.
it is not broken at all.
$node->path is NOT shown to the public and there must be a reason for that.
Have you tried to do what I have recommended to you?
Open the "Edit View" page, add a field named "Link to Node" and theme the field.
Regards,
José San Martin
José San Martin
http://www.chuva-inc.com/
Did that, done, explain how this is "BAD"
I already did the "Link to Node" and when I do a print_r($node); still not link/path to the node, which is what I need.
Since someone else suggested to do it, it seems like it's a common problem. Why don't I want people to see the url path? The whole point is to make sure they can, via the view. Explain how this could be exploited in a bad way, currently I don't see how it could be, since it's JUST the path, and nothing else.
Try This
Hey Guys I was also after a solution, needed to break apart the link and shove some HTML in the link tag, anyway maybe this will help:
http://drupal.org/node/87223#comment-164474