drupal-7

Creating list of similar nodes in Drupal 7/Views 3

安稳与你 提交于 2019-11-28 15:16:38
Copy from drupal.stackexchange.com hoping to get more answers here: I face a rather common problem of displaying a list of nodes similar to current one. Similar node is defined as one having at least one taxonomy term that current node has. There are few solutions available as modules, however the modules I've found (specifically Similar By Terms) are in beta stage (as in "not working properly") for Drupal 7. I've also found a couple of solutions based on Views and contextual filters (such as http://scito.ch/content/show-related-nodes-block-based-taxonomy-terms-views-3-and-drupal-7 ) or

How Drupal works? [closed]

放肆的年华 提交于 2019-11-28 13:08:36
问题 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 . Could someone provide a architectural overview of the Drupal 7 control flow? Perhaps in the sense of a flowchart about how a page gets generated. What additional resources would you suggest consulting with regards to how Drupal works? 回答1: Drupal can be confusing on this front, partially because it has a

How to debug PHP in MS Azure

房东的猫 提交于 2019-11-28 12:50:26
问题 First things first: I was given the task to deploy a Drupal website on Azure. Locally I use OS X running Apache and everything works ok. When I deploy the project to Azure, I get an error. After some debugging I isolated the error to this snippet of code: private function getToken(){ $ch = curl_init($this->host . $this->clientId . "&client_secret=" . $this->clientSecret); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json',));

Symlink is not working in my local machine

 ̄綄美尐妖づ 提交于 2019-11-28 12:42:50
问题 I'm using Xampp setup in Windows 7 machine. I am trying to configure sub-folder module in Drupal 7. But it says "Cannot create symlink, error code(1314)" error which stops me in configuring the module properly. And subfolder module functionality is not working as expected. 回答1: This is a Windows error message indicating that the current user does not have permission to create symbolic links. By default, this privilege is granted to administrators only. Your options for fixing this are either

File system is not writable

放肆的年华 提交于 2019-11-28 10:27:00
问题 I installed Drupal 7 in a web host successfully. After installing a module, I got an error errors and and status report gave me this error message: File system Not writable The directory /Applications/MAMP/tmp/php does not exist. You may need to set the correct directory at the file system settings page or change the current directory's permissions so that it is writable. I check the permissions for (sites/default/files) and it has 755 permissions and I change it to 777 but nothing happened

Changing video content type (mime type) in CDN in drupal 7

二次信任 提交于 2019-11-28 09:32:23
问题 I am using media module to save media in CDN. To play videos, we are using jwplayer in Drupal 7. Jwplayer throws error in IE, If video is not of content type [mime type] * video/mp4 *. I have changed the existing CDN videos mime type from application/octet-stream to video/mp4 . Now whatever mp4 videos are being uploaded/saved to cdn should only be of video/mp4 mime type but when I upload mp4 videos in media module it is saved in CDN with mime type application/octet-stream, How do I change the

How to display node/add/sometype form on another page?

核能气质少年 提交于 2019-11-28 04:21:54
The whole problem is following: Lets say we have Items, Items can have Bids, Items can have Questions and Question can have Answer. When an Item is displayed, all content associated with this Item should also be displayed. Additionally depending on roles, certain forms to make Bids, ask Questions and replay Answers should be display. How to achieve this? Should I have separate node type for each type? Or should I treat some subtypes like Questions and Answers as comments? Should I use some well-known modules for this? I am using Drupal 7 and I tried to write a custom module but I didn't get it

Attaching image files to nodes programmatically in Drupal 7

ぐ巨炮叔叔 提交于 2019-11-28 03:20:00
Is it possible to add an image to a node programmatically? Here is an example code using which you can use with node_save $filepath = drupal_realpath('misc/druplicon.png'); // Create managed File object and associate with Image field. $file = (object) array( 'uid' => 1, 'uri' => $filepath, 'filemime' => file_get_mimetype($filepath), 'status' => 1, ); // We save the file to the root of the files directory. $file = file_copy($file, 'public://'); $node->field_image[LANGUAGE_NONE][0] = (array)$file; ` An easier way: $filename = 'image.txt'; $image = file_get_contents('http://www.ibiblio.org/wm

Drupal 7: how to restrict file access to specific user roles

别来无恙 提交于 2019-11-27 21:53:27
问题 I need to develop a site on Drupal 7. I have some content types with File fields in CCK. And access to nodes of these types should be granted only to specific Drupal user role. And at any moment site administrator should be able to make these Nodes 'public' or 'private'. I can make nodes visible only to specific user roles, but this is not secure enough. If anonymous user knows the path to file ( www.mysite.org/hidden_files/file1 ), he can download it. What is the most elegant way to solve

How to implement hook_theme in drupal 7?

扶醉桌前 提交于 2019-11-27 18:10:19
问题 I created a new drupal 7 theme and trying to implement hook_theme at template.php like this: function mytheme_theme($existing, $type, $theme, $path){ return array( 'mytheme_header'=>array( 'template'=>'header', 'path'=>$path.'/templates', 'type'=>'theme', ), ); } then I placed header.tpl.php into templates directory and cleared all caches, and call theme function: theme('mytheme_header', $vars); and header.tpl.php likes this: <?php fb('calling header template');//the function of FirePHP to