drupal

Adding images into blocks html

南楼画角 提交于 2019-12-22 08:17:32
问题 I've added some html code in my Blocks content and enabled Full HTML filter. I've used relative paths for my images, such as "sites/all/themes/zen/zen/image.png" I guess this is not correct because I need to change my paths depending on I'm in the home page or "node/id" page. I guess I cannot use PHP inside blocks, thus I cannot use $base_url... how can add images path with only html ? thanks 回答1: The previous answers provide a part of the solution, but here's a fuller scoop: Hand-written

Add CCK field to custom form in Drupal 7

喜夏-厌秋 提交于 2019-12-22 07:02:58
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

Add CCK field to custom form in Drupal 7

為{幸葍}努か 提交于 2019-12-22 07:02:14
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

Drupal: Are hook_ functions in *.api.php ever called?

故事扮演 提交于 2019-12-22 04:45:18
问题 In Drupal 7, every core module has a *.api.php file, where * is the name of the module. For example modules/node/node.api.php modules/path/path.api.php What are these files for? They contain functions that start with hook_ , and the name of a hook that (I think) the module invokes. For example modules/system/system.api has function hook_entity_view($entity, $type, $view_mode, $langcode) { $entity->content['my_additional_field'] = array( '#markup' => $additional_field, '#weight' => 10, '#theme

XAMPP PhpMyAdmin Error 1045, "Access denied for user 'root'@'localhost'

心已入冬 提交于 2019-12-22 04:42:18
问题 I see this question has been asked many times, but I don't find a solution for my problem. Tried all possible combinations in config.inc.php $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root'; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Lang'] = ''; /* Bind to the localhost ipv4 address and tcp */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect

How to get rid of Drupal CSS stylesheets?

回眸只為那壹抹淺笑 提交于 2019-12-22 04:08:24
问题 I am trying to accomplish the following. I need to use Drupal 6 as a project requirement, but I want to use it with my own HTML and CSS stylesheets for each node/view/panel etc. The problem is, whatever the theme, I always found that Drupal applies to my HTML content both my CSS stylesheets and the CSS related to the theme chosen. I have also tried, without success, using the stylestripper module (installed in sites/all/modules). No matter what I do, additional CSS stylesheets are applied to

Render a Drupal node

元气小坏坏 提交于 2019-12-22 02:34:07
问题 I would like to show a node inside another node. So I retrieve the node id of the second node and I would like to render/print/... it inside another node. But I'm not sure how to do this. I've tried drupal_render , node_view , print ,... but with no results. Any advice? $nid = $node->field_linked_fiche['und'][0]['nid']; $fullFiche = node_load($nid); EDIT - the whole template <?php /** * @file * Bartik's theme implementation to display a single Drupal page. * ... */ ?> <div id="page-wrapper">

Drupal theme functions workflow in module

邮差的信 提交于 2019-12-22 01:34:37
问题 I am a bit newbie in Drupal theming and I can't get one detail in Forum modules theming. forum.module file contains forum_theme function that controls how this module is themed and has this line function forum_theme() { ...... 'forum_list' => array( 'template' => 'forum-list', 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), I also see forum-list.tpl.php file in forum directory, so I start to wonder when this file is called and where it gets data from, but all I

Drupal 网站漏洞修复以及网站安全防护加固方法

夙愿已清 提交于 2019-12-22 01:13:01
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> drupal是目前网站系统使用较多一个开源PHP管理系统,架构使用的是php环境+mysql数据库的环境配置,drupal的代码开发较为严谨,安全性较高,但是再安全的网站系统,也会出现网站漏洞,drupal是网站运行访问必不可少的一个分支,为了网站的安全,不被攻击者攻击,我们要对网站以及服务器进行全面的安全加固与安全设置,包括我们服务器安全设置,web安全设置,php环境安全设置,msyql数据库安全设置,都要详细的安全加固好,才能保障整个网站的安全稳定运行。 关于目前出现的drupal漏洞,我们都要对其进行漏洞修复,以及网站安全加固与安全防护,对于如何修复drupal漏洞,我们应该从最基础的代码安全入手,我们应该从下面的几个点开始: 从哪里来就应该到哪里去,从最基础的代码入手,大多数的网站使用的drupal系统开发的,基本都会适用于下列的几种情况,使用大多数网站运营者的一个社区开发的安全解决方案,可以对drupal系统进行更好维护与升级,检查drupal的版本为最新,完整。尽量的使用系统默认的配置以及代码,不要找第三方网站开发公司进行开发与设计,默认的一些安全属性不要去碰,只有再不得已的情况下才开启权限,默认是不能开启。网站的运行权限避免使用root管理员权限,使用普通的账号权限去运行

SonarQube for Drupal Projects

北城以北 提交于 2019-12-22 00:28:36
问题 Currently i am using SonarQube with latest version 5.0 . I am using SonarQube for scanning PHP projects with PHP plugin. Now there some queries which i having regarding SonarQube and PHP Plugin. Why SonarQube guys deprecated the old PHP Plugin which is more configurable than the Previous one. Is it possible to Analyze Drupal Projects with SonarQube. Thanks in advance for the answers. 回答1: After doing so much research for SonarQube Coding Standards i came to following conclusion. please find