English 中文(简体)
在第七卷中,如何从无产权处获得退款?
原标题:in drupal 7, how to get node id from node title?
  • 时间:2012-05-13 16:00:54
  •  标签:
  • drupal
  • load

我知道头衔,我希望从标题中删除,我尝试了两种方式,但并未适当开展工作。

1 P-4, 1 P-3, 1 FS, 1 NS

$title = arg(2); // get node title from the url 
$node = node_load(array( title  => $title));    
$nid = $node->nid;
print $nid;

错误说: Can only flip STRING and INTEERT Value! in DrupalDefaultEntityController->load(,Trying to have property of non-object

2)

 $items = entity_load( node , FALSE, array(
             type  =>  article ,
             title  => arg(2),
    ));

但是,我应该做些什么?

最佳回答

Node nid只能是数字和独特价值。 标题不是数字价值,而是用户所用的数字价值,美元的标题与诺德和特尼德没有任何关系。 你可以有10个不同的节点,标题相同。 还请:

http://api.drupal.org/api/drupal/modules%21node%21node.module/Function/node_load/7

http://api.drupal.org/api/drupal/includes!common.inc/Function/entity_load/7

问题回答

暂无回答




相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...

热门标签