[support] node_load in Drupal 7

Joel Willers joel.willers at sigler.com
Tue Jan 24 13:40:47 UTC 2012


I’m trying to create a page that accepts the title of a content type as an argument: example.com/type/title_of_node/option and I want to be able to have the node editable on each of the options pages.

For instance:
example.com/type/title_of_node will show the base node.
example.com/type/title_of_node/images will show the description, plus an image gallery of all associated images, with the ability to edit the node.
example.com/type/title_of_node/videos will be similar, showing video gallery, with the ability to edit the node.

I can’t send the node ID, it has to be the node title. Any other thoughts for a solution?

Joel

From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On Behalf Of Ms. Nancy Wichmann
Sent: Monday, January 23, 2012 9:39 PM
To: support at drupal.org
Subject: Re: [support] node_load in Drupal 7

Are you sure you don't have the nid somewhere? How did you get to the Panel without it?

The problem with using the title is the node's title need not be unique. What are you going to do if there are two nodes with the same title? Yes, you could use the Views context - it's really not difficult if you read the form descriptions.

Nancy

Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.

________________________________
From: Joel Willers
In Drupal 6, you could node_load( array( 'title' => 'node title', 'type' => 'page' )
Is there something similar in D7? It seems to force you to know the NID. I need to load by node title.

This is actually for a Panel context, which is NID also, so I was going to make a new argument for Node Title. I think there is a Views Context, but I don't fully grasp that right now, so I haven't really looked into it. Suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120124/7035861d/attachment.html 


More information about the support mailing list