Drupal 8的目标之一就是开箱即用,Drupal核心现在有了一套ReST API
这使得用户在使用Drupal 8的各种功能输入内容之后,不仅可以把内容呈现到标准的Drupal前端中,而且还可以输出给移动应用以及其他的能使用JSON数据的应用之中。
ReST
Drupal 8使用两个Module来提供ReST API。rest模块,为Angular JS之类的能够使用’Accept: application/json’头提供最简单的响应。他的工作很简单,只是Drupal 8 Entity的序列化输出。
下面是一个JSON响应的例子
Drupal中国每周翻译任务认领,有时间有兴趣参与翻译的,可直接编辑本wiki,在认领条目后加入自己的名字。
翻译完后,可直接发布到自己网站、博客,或者Drupal中国上面。经常参与翻译的朋友,后续社区会记录并发放适当嘉奖,欢迎参与!
前人栽树,后人乘凉,参与翻译,乐在其中!
Constructive Conflict Resolution in the Drupal Community(took by Tim)
http://www.previousnext.com.au/blog/constructive-conflict-resolution-drupal-community
The Challenge to Innovation
http://www.metaltoad.com/blog/challenge-innovation
Are you Giving Back?
http://www.lightsky.com/blog/are-you-giving-back (蓝眼泪)
报名地址:https://groups.drupal.org/node/439483#signup-form
时间:2014年10月18日10:00 - 19:00
地点:中山北路900号(近普善路)加禾商务中心2号楼311室
大家好!
很期待在Drupal 10月聚会上跟各位见面。
In the 'page--landing.tpl.php' file, the menu is created with: //--页面菜单添加新窗口打开的链接 <div id="menu"> <?php print $navigation; ?> </div> <?php A quick way would be to use jQuery to rewrite the anchor tags in the menu with the target attribute //--方法一,使用jquery $( '.page--landing [menu link selector] ).attr( 'target','_blank' ); Using the Drupal API //方法二:使用hook_menu_link_alert function MODULE/THEMENAME_menu_link_alter(&$item) { if (some logic that sets it only for the desired paths/context) { $item['options']['attributes']['target'] = '_blank'; } } an
一直想找一个能够图表述出的模块, drupal有没有曲线图表述出的Moudel?有推荐的吗?
比如:记录日常开支形成个曲线表,像淘宝消费那种曲线。
<?php /** * Implementation of hook_enable(). */ function addexample_enable() { // Check if our field is not already created. if (!field_info_field('field_myfield')) {//--字段名称需要小写 $field = array( 'field_name' => 'field_myfield', 'type' => 'text', ); field_create_field($field); // Create the instance on the bundle. $instance = array( 'field_name' => 'field_myfield', 'entity_type' => 'user', 'label' => 'My Field Name', 'bundle' => 'user', // If you don't set the "required" property t
Drupal 8.0.0 Beta2 在美国当地时间2014年10月15日下午5:03发布了。
该版本是Drupal官方发布的第2个Drupal8 Beta版本,上一个Drupal8 版本是Drupal8 Beta1,发布于2014年10月1日,相隔仅有14天的时间。
这一版本对Drupal8 Beta1 修复:242个问题,详细参见官网的发布说明(Release notes): https://www.drupal.org/node/2357303,包括一个安全漏洞问题: SA-CORE-2014-005。
Drupal 8 Beta 版不适合没有技术背景的人和生产环境使用,因为在目前仍有116个较严重的问题亟待解决,解决所有这些问题将会发布RC版(release candidate,候选版)。
(Drupal中国公告)2014年10月15日12点47分(美国当地时间)在Drupal官网发布公告,Drupal 7.32 发布。
Drupal官网公告中介绍此次 Drupal 7.32 主要是安全漏洞的修复。可以到 Drupal 7.32版本修改日志里查看具体细节。
本次更新包括:
官网强烈建议升级您的Drupal站点至drupal7最新版本,此次更新没有增加新功能。
修改日志:
Drupal 中的session 为何要存放在 database 中,不用database存储岂不是更快?
<?php //--hook_node_view($node, $view_mode, $langcode) function addtabexample_node_view($node, $view_mode, $langcode) { $my_form = drupal_get_form('addtabexample_form', $node); $node->content['my_form_attached'] = array( '#markup' => drupal_render($my_form), '#weight' => 10, ); } //--预定义的表单 function addtabexample_form($node, &$form_state) { $form['title'] = array( '#type' => 'textfield', '#title' => 'Title' , '#default_value' => !empty($node->title) ?