有人可以指导我吗?
我有五个图像与我隐藏的节点相关联.我想在一个街区中展示它们.
如何在属于当前显示的节点的块中显示图像?那么当节点发生变化时,它会自动加载该节点上的图像?我认为这与添加过滤器有关.
但是,当我看到这些列表时,我似乎无法获得任何
"当前节点"过滤器.我还读到我可以将当前节点的参数传递给块.但是在drupal 7中,在编辑块时没有这样的字段称为"参数"....
谢谢
我是drupal主题的新手.我创建了一个direcory mytheme并添加mytheme.info到它并从drupal的默认主题目录中复制了其他文件.编辑后page.tpl.php,drupal显示下面的错误.
Notice: Undefined variable: hide_site_name in include() (line 99 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined variable: hide_site_name in include() (line 109 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: featured in include() (line 168 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: highlighted in include() (line 187 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: sidebar_second in include() (line 212 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_first in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_middle in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: …Run Code Online (Sandbox Code Playgroud) 我可以为Drupal的AJAX Throbber和Progress Bar设计风格吗?要覆盖哪些类或ID?
为什么我们使用"drupal形式"虽然我们可以通过"HTML表单"做所有事情?
我没有经验的PHP(我是新的).
我正在尝试使用此代码http://mach13.com/how-to-get-a-variable-name-as-a-string-in-php来查找变量的名称,但我一直在:
该行的数组到字符串转换:
$aDiffKeys = array_keys (array_diff_assoc ($aDefinedVars_0, $aDefinedVars));
Run Code Online (Sandbox Code Playgroud)
而且当我使用时,我得到"只有变量应该通过引用传递"
var_name($a, get_defined_vars());
Run Code Online (Sandbox Code Playgroud)
如何让这些消息消失?因为整个代码都在工作(我得到了所需的输出).
这是代码
<?php
function var_name (&$iVar, &$aDefinedVars)
{
foreach ($aDefinedVars as $k=>$v)
$aDefinedVars_0[$k] = $v;
$iVarSave = $iVar;
$iVar =!$iVar;
$aDiffKeys = array_keys (array_diff_assoc ($aDefinedVars_0, $aDefinedVars));
$iVar = $iVarSave;
return $aDiffKeys[0];
}
$a=12;
echo var_name($a,get_defined_vars());
//ini_set('display_errors', '0');
?>
Run Code Online (Sandbox Code Playgroud) 我试图制作一个干净的jQuery代码,我把所有的东西都放在一个我称之为"每个"的函数中.问题是没有任何反应,并且在控制台中没有出现任何错误.
这是一个示例代码:
$(function() {
$('.myElement').each(function() {
if($(this).children()) {
myFunction();
} else {
myFunction('.myOtherElement');
}
});
});
function myFunction(selector) {
if(!selector) {
$(this).html('Finish');
} else {
$(this).find(selector).html('Finish');
}
}
Run Code Online (Sandbox Code Playgroud)
如果我把我的功能内容放在.each它可以工作,但在一个单独的功能,但我认为它应该工作.为什么这段代码不起作用?
我有一个iOS应用程序,它将一个JSON数据包发送到网络服务器.网络服务器代码如下所示:
var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var app = express();
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function (callback) {
console.log("MongoDB connection is open.");
});
// Mongoose Schema definition
var Schema = mongoose.Schema;
var LocationSchema = new Schema({
X: Number,
Y: Number,
Orientation: Number,
UserID: String,
Time: String
});
// Mongoose Model definition
var LocationsCollection = mongoose.model('locations', LocationSchema);
// create application/json parser
var jsonParser = bodyParser.json();
// URL management
app.get('/', …Run Code Online (Sandbox Code Playgroud) 我现在创建模块我想在该模块上设置权限,以便一些用户可以看到该字段.我搜索谷歌和stackoverflow但我没有得到正确的答案,因为我需要.我的代码如下
function downloaded_menu() {
$items['user/%user/downloaded_poems'] = array(
'title' => 'Downloaded Poems',
'page callback' => 'downloaded_content_page',
'access arguments' => array('poet downloaded work'),
'type' => MENU_LOCAL_TASK,
'weight' => 11,
);
return $items;
}
Run Code Online (Sandbox Code Playgroud)
现在我想给予特定用户许可.谁只能看到.
尝试在新的内容类型添加表单中添加一些额外的表单项。
还要尝试增加提交和预览的权重。
function mymodule_form_alter(&$form, &$form_state, $form_id){
//add some $form items here
$form['actions']['submit']['#weight'] = 2000;
$form['actions']['preview']['#weight'] = 2001;
}
Run Code Online (Sandbox Code Playgroud)
但不知何故,提交和预览按钮仍然位于添加的新项目上方。
我想开发一个模块,在drupal 7中为用户配置文件添加字段,如电话号码和CV ......我不知道该怎么做(使用数据库或使用字段API)请帮助我.
任何明确的教程将不胜感激.
drupal ×7
drupal-7 ×7
php ×6
javascript ×2
ajax ×1
body-parser ×1
drupal-6 ×1
drupal-fapi ×1
drupal-forms ×1
drupal-views ×1
jquery ×1
mongodb ×1
mongoose ×1
node.js ×1
throbber ×1