drupal

PHP throws 'Allowed memory exhausted' errors while migrating data in Drupal

霸气de小男生 提交于 2019-12-13 17:06:32
问题 I'm trying to setup a tiny sandbox on a local machine to play around with Drupal. I created a few CCK types; in order to create a few nodes I wrote the following script: chdir('C:\..\drupal'); require_once '.\includes\bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); module_load_include('inc', 'node', 'node.pages'); $node = array('type' => 'my_type'); $link = mysql_connect(..); mysql_select_db('my_db'); $query_bldg = ' SELECT stuff FROM table LIMIT 10 '; $result = mysql_query($query

Drupal 6: Views: Listing taxonomy terms with tagged nodes underneath

 ̄綄美尐妖づ 提交于 2019-12-13 16:22:00
问题 I need to create a view that lists out taxonomy terms and then list the top 3 recent(sort by node:date updated) nodes with that tag example out put: Article Article 1 Article 2 Article 3 Podcast Podcast 1 Podcast 2 Podcast 3 . . . I created a view of type "Term" and I can get the view to output all of the terms. However, I don't see how to link in the nodes tagged with the taxonomy term. I looked around in the view of type node, but I couldn't get anywhere close to what I needed to output.

Acces raw data in Drupal 8 view template

旧街凉风 提交于 2019-12-13 16:21:19
问题 In a overridden template of the View module (views-view-field.html.twig), i'm trying to access to the raw data of a field. In the doc file, we can read this: * Available variables: ... * - fields: A list of fields, each one contains: ... * - raw: The raw data for the field, if it exists. This is NOT output safe. ... but it's alway's empty. {{ dump(fields.field_myfieldname) }} print object(stdClass)[1899] ... {{ dump(fields.field_myfieldname.raw) }} print null I want the raw to build a file

custom page-xxxx.tpl.php doesnt works

时间秒杀一切 提交于 2019-12-13 16:15:15
问题 I have page named page--news.tpl.php, which i created for my news page. But after i cleared my cache, page still not using, and drupal use the original page.tpl.php. Any ideas how to solve it? 回答1: An alternate way of doing it, is through preprocess hook with few lines of code. Here's how it goes function <module_name>_preprocess_page(&$variables) { if (isset($variables['node'])) { $variables['theme_hook_suggestions'][] = 'page__'.$variables['node']->type; } } Suppose you have a node type as

What is the opposite of Access Callback user_is_anonymous?

给你一囗甜甜゛ 提交于 2019-12-13 14:40:49
问题 I know that is used in a drupal module to specify that only anonymous users can see that module. What would be the callback that specifies only logged in users ? I have a page that I only want accessible to logged in users. Thank You 回答1: It is the user_is_logged_in() function, which basically checks that the user's ID ($GLOBALS['user']->uid) is greater than zero. The function converts the uid into a Boolean type and returns TRUE for any user that is logged in, because they would have a uid

Why is my Drupal 8 CORS setup not working?

醉酒当歌 提交于 2019-12-13 14:15:34
问题 Since Drupal 8.2 the cors setup is in core. In my services.yml (and default.services.yml ) I have the following setup: cors.config: enabled: true # Specify allowed headers, like 'x-allowed-header'. allowedHeaders: ['x-csrf-token','authorization','content-type','accept','origin','x-requested-with'] # Specify allowed request methods, specify ['*'] to allow all possible ones. allowedMethods: ['*'] # Configure requests allowed from specific origins. allowedOrigins: ['*'] # Sets the Access-Control

Can Drupal terms in different Taxonomies be synonymous?

梦想的初衷 提交于 2019-12-13 12:31:32
问题 Let's say Taxonomy_A is associated to Node_Type_A Taxonomy_B is associated to Node_Type_B . AND Both Taxonomy_A and Taxonomy_B have a term called ' yellow '. Is it possible to make terms ' yellow ' synonymous, so that if I'm looking at a list of ' yellow ' stuff, I'm seeing content of both types ( Node_Type_A , and Node_Type_B )? Progress: Unfortunately it is not possible for taxonomy terms to behave in Drupal as described in my question (at least not without forcing it): It is clear by

Is it possible to customise drupal node reference and pass your search and a argument from another field

谁说胖子不能爱 提交于 2019-12-13 12:14:32
问题 I'm trying to create a bespoke form in drupal, with a node reference field. I'd like to add a little extra functionality to the node reference auto complete. I've created a view, that contains an argument. I'd like to be able to pass that argument from a drop down as well as the typed text into the autocomplete script. Does anyone know how I'd start this off. /* FIELD 1 - the drop down */ $sql = "SELECT nid, title FROM node where type='resourcetype' AND status =1 order by title "; $result =

How to add my own PHP code in Drupal [closed]

泄露秘密 提交于 2019-12-13 11:15:50
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . First of all i would like to say that i dont know little bit of Drupal. But i have a requirement that i should integrate a particular module (its not a drupal module) from one stand alone website to drupal site.

Server error 500 [closed]

∥☆過路亽.° 提交于 2019-12-13 09:55:38
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am working on drupal7. When I try to open the website, it gives internal server error: HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill