drupal-7

Add FORCE INDEX with drupal query builder

时光毁灭记忆、已成空白 提交于 2019-12-11 16:03:46
问题 I am developing a website using Drupal 7 . I was using a query with the help of function db_query . But now I am planning to restructure it and use the db_select format. But at one portion, I am using a FORCE INDEX() to force the use a particular index to overcome a drawback of old MySql version. Is there any way to add this force index with the join() in db_select? 来源: https://stackoverflow.com/questions/52215360/add-force-index-with-drupal-query-builder

Drupal hook_menu explanation

☆樱花仙子☆ 提交于 2019-12-11 15:45:58
问题 I have been searching the net and i have not found out anywhere that explains the access callback and access arguments for hook_menu. What I think so far is that it controls who can access the module (correct me if I am mistaken). So can someone explain how hook_menu access callback and access arguments works and how you would go about if you were going to set the module to only administrators or only registered users to see your module. Also I am working on Drupal-7 回答1: I think what you are

Scale background image to fit ie8 window

本小妞迷上赌 提交于 2019-12-11 14:14:04
问题 I'm using a drupal 7 module to load in a background image but IE8 doesn't support css3 resizing. background-image: url('image.jpg'); background-size: cover; I can't easily load in the image using the usual methods such as putting it in a DIV or using the ms-filter alphaimageloader to load it. A javascript solution is fine if this can't be done with just CSS that ie8 supports. (Something that also works for ie7 would be fantastic too, but ie8 is the priority). 回答1: Add Full Size Background

Drupal Multisite using subfolder

╄→尐↘猪︶ㄣ 提交于 2019-12-11 13:55:49
问题 i want to have another drupal-site in a subdirectory using multisites. Assuming I have the domain foo.example.com and the folder sites/foo.example.com. I want to new site to be at foo.example.com/bar. So according to the describtion in the settings php i'd simply have to setup a folder sites/foo.example.com.bar. Well… I did. Yet it does still load the site of sites/foo.example.com/. What am i doing wrong? 回答1: You might need to create a symbolic link inside the Drupal root pointing to itself.

Custom blocks not working in Drupal 8

偶尔善良 提交于 2019-12-11 11:46:45
问题 I'm building a module with custom block in Drupal 8 beta 9. When I create a block in my module I'm placing it in src\Plugin\Block directory. The block show in 'Block structure' list, but when I press link to add it, nothing happens. I reviewed my code 10 times, tried to put my files into core module's directories (only for test obviously), tried to put some core block files to my directory, to copy-paste code. None of this works. Here is a code of my block file: <?php /** * @file * Contains

Drupal 7: how to filter view content (with entity reference field) based on current page content

被刻印的时光 ゝ 提交于 2019-12-11 10:22:44
问题 in my drupal 7 I have 2 content-types like these: ContentA ContentB (with a field Entity Reference to ContentA) In the front-end detail page of ContentA, I would love to show a block/view with a list of ContentB whose Entity Reference field is set to the current ContentA. I made a view of type Block and added it correctly to the page, but I cannot filter ContentB based on the current ContentA. Could you help me? Thanks 回答1: You should add a contextual filter for the value you will use for

How to convert SelectQuery object to SQL string?

蓝咒 提交于 2019-12-11 09:56:46
问题 I managed to print a string using __toString() magic method, but in this string I see placeholders (for conditions params), and it doesn't work as SQL query. I checked documentation of this object, and also looked in google, but couldn't find a working answer. 回答1: Basing on question's comments (thanks @Scuzzy for inspiration) I wrote some simple piece of code to convert SelectQuery object: class ExportableSelectQuery { public static function toSql(SelectQuery $obj) { $_string = $obj->_

How to fix the php 5.6 mbstring issue in Centos 6.7?

ぃ、小莉子 提交于 2019-12-11 09:55:45
问题 I've been running a Drupal 7 site on Centos 6.7 and php 5.3, and have finally gotten around to updating php to 5.6.20. The update went well; the only problem I'm hitting is that I'm getting log messages about mbstring.http_input (and mbstring.http_output ) being deprecated: PHP Deprecated: Unknown: Use of mbstring.http_output is deprecated in ... I've seen no shortage of articles (e.g., MAMP: php.ini - mbstring.http_input - Disabling for Drupal) talking about how the solution is to get: php

Drupal - Tokens for Webform Component Values [closed]

折月煮酒 提交于 2019-12-11 09:49:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there a way to set up a Webform such that I can turn component field submissions into tokens for use in the submission email? For example, I want to include "Message from [email address]" in the email subject line. The default options only allow for including only the component field in the email (subject:

Drupal Homepage Title in Browser Tab

╄→гoц情女王★ 提交于 2019-12-11 09:29:28
问题 I am looking for help with an issue. The drupal 7 site I am working on has a custom homepage. When you go to homepage, on the browser tab, it initially shows the name of the site "NPE" but then it changes to "Homepage Title". I've checked the metatags and everything seems to be right. Does anyone have experience with this or other suggestions as to what could be causing this? 来源: https://stackoverflow.com/questions/47207307/drupal-homepage-title-in-browser-tab