[英]How to access content type description in custom template file of Drupal7?
我想訪問 Drupal7 網站的自定義模板文件中的內容類型描述。 在這個模板文件中,我顯示了內容列表。 現在,在該列表的頂部,我還想顯示該內容類型的描述。
使用它可以訪問內容類型名稱。 還有什么方法可以訪問描述嗎?
$types = node_type_get_names('names');
在 drupal 論壇中找到了這個,但 node_get_types function 拋出錯誤。
$types = node_get_types();
print $types['blog']->description;
我想你可能正在尋找
node_type_get_types
https://api.drupal.org/api/drupal/modules%21node%21node.module/function/node_type_get_types/7.x
有人在 api 文檔中發布了 object 的轉儲,但為了完整起見,我將其復制到此處。
Array
(
[article] => stdClass Object
(
[type] => article
[name] => Article
[base] => node_content
[module] => node
[description] => Use articles for time-sensitive content like news, press releases or blog posts.
[help] =>
[has_title] => 1
[title_label] => Title
[custom] => 1
[modified] => 1
[locked] => 0
[disabled] => 0
[orig_type] => article
[disabled_changed] =>
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.