Skip to Content

Drupal

  • strict warning: Non-static method view::load() should not be called statically in /var/www/drupal_module/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /var/www/drupal_module/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/www/drupal_module/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/www/drupal_module/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /var/www/drupal_module/views/modules/node/views_handler_filter_node_status.inc on line 0.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /var/www/drupal_module/views/plugins/views_plugin_style_default.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /var/www/drupal_module/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /var/www/drupal_module/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Only variables should be passed by reference in /var/www/truevue.org/sites/all/themes/zeropoint/template.php on line 341.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/drupal_module/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/drupal_module/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/drupal_module/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/drupal_module/views/views.module on line 906.
  • strict warning: Declaration of views_handler_field_comment::init() should be compatible with views_handler_field::init(&$view, $options) in /var/www/drupal_module/views/modules/comment/views_handler_field_comment.inc on line 0.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /var/www/drupal_module/views/handlers/views_handler_filter_boolean_operator.inc on line 0.

Drupal模块:Term Fields

Drupal模块Term Fields可以给Term添加Fields,就像通过CCK给node添加fields一样,觉得这个模块比NAT更好,更高效。

Drupal模块:Node Auto Term [NAT]

Drupal的Node Auto Term (NAT) 模块是个自动生成Term的模块,将Term和Node直接联系起来,通过Node来丰富Term的内容,使得Term能够有多用途。

Drupal主题:标签(Taxonomy Term)按类别显示

在Wordpress中,标签会按照类别显示。不过Wordpress就两种标签:文章分类和标签。在Drupal中,你可以创建不同类型的标签,如:文章分类,文章地点,涉及人物,天气等等类型(Vocabulary)。但是默认时会将这些标签(Taxonomy Terms)显示在一起,我们可以用下面的代码将这些标签按类别分开显示:

Drupal主题:为摘要(teaser)页面制作专门的主题模板

有下面的三种方法可以为摘要页面制作单独的主题:

方法一:

<?php
if ($teaser) { 
  // node is being displayed as a teaser
  // Anything here will show up when the teaser of the post is viewed in your taxonomies or front page
} else { 
  //all other cases
  //Anything here will show up when viewing your post at any other time, e.g. previews
}
?>

Drupal PHP5.3 Issue: Attempt to modify property of non-object (Date module)

用VPS后,安装的PHP版本是最新的5.3版,Drupal Date模块会出现下面的warning信息:

warning: Attempt to modify property of non-object in ../sites/all/modules/date/includes/date_plugin_display_attachment.inc on line 24.

可以用下面的方法进行解决:

Drupal模块:Boost缓存

Boost模块介绍:

Drupal自带有Cache模块,但是好像效果一般,看到网上有人推荐Boost,说Boost不错。

Boost会创建静态html页面进行缓存,创建相应的.htaccess转发规则,然后根据.htaccess转发规则进行静态页面解析。

Drupal Theme Varaibles Used in node.tpl.php

Drupal Theme implementation to display a node.

Available variables:

  • $title: the (sanitized) title of the node.
  • $content: Node body or teaser depending on $teaser flag.
  • $picture: The authors picture of the node output from theme_user_picture().
  • $date: Formatted creation date (use $created to reformat with format_date()).
  • $links: Themed links like "Read more", "Add new comment", etc. output from theme_links().
  • $name: Themed username of node author output from theme_username().
  • $node_url: Direct url of the current node.
  • $terms: the themed list of taxonomy term links output from theme_links().
  • $submitted: themed submission information output from theme_node_submitted().

Druapl PHP Varaibles Can be Used in page.tpl.php Theme Template

Drupal Theme implementation to display a single Drupal page.

Available Drupal PHP variables for theme template:

Drupal General utility variables:

  • $base_path: The base URL path of the Drupal installation. At the very least, this will always default to /.
  • $css: An array of CSS files for the current page.
  • $directory: The directory the theme is located in, e.g. themes/garland or themes/garland/minelli.
  • $is_front: TRUE if the current page is the front page. Used to toggle the mission statement.
  • $logged_in: TRUE if the user is registered and signed in.
  • $is_admin: TRUE if the user has permission to access administration pages.

Drupal不同节点类型使用不同模板

Drupal有独立的主题机制(theme engine),这个engine使得Drupal的模板控制非常灵活,与此同时要掌握Drupal主题机制就显得不是那么容易了。

Drupal的主题模板文件有一些tpl.php文件组成,这些文件包括:

  • node.tpl.php
  • page.tpl.php
  • block.tpl.php
  • template.php

Drupal View实现随机文章

WordPress有个插件(Random Articles Wordpress Plugin)可以实现随机文章区块。Drupal好像没有随机文章(Random Articles)模块,那么Drupal怎么实现随机文章区块呢?

其实很简单,用View就可以实现随机文章。只要在Sort Criteria里面选择添加 Global: Random排序条件即可。