drupal

Drupal External Authentication

守給你的承諾、 提交于 2019-12-24 16:31:05
问题 I have a cURL PHP script which is able to validate a username/password against the external source. What is the best way to integrate this as a login requirement for (select) users in Drupal? 回答1: To start with, you could look at the code of the OpenID module that comes with Drupal 6 - creating a new module based on this code should get you 90% of the way. It allows existing users to associate OpenIDs with their accounts, and it sounds like you'd need to do something similar from your reply

REST server in Drupal6

久未见 提交于 2019-12-24 12:58:51
问题 i would like to build a REST service in my Drupal module to expose contents of my DB tables (not nodes, users or other Drupal stuff); i've installed Rest_server and services modules but i've not found examples on creating rest services. Can anyone help me, please? Thanks and greetings c. 回答1: The book "Drupal web services" by Packt is a good resource. They have free Services introduction online too. 回答2: Have a look at: Drupal as backend for RESTful API? Also, did you had a look at the

drupal 7 views block and contextual filter not working

孤人 提交于 2019-12-24 12:12:05
问题 I'm trying to set a contextual filter for a block type views but when I preview it, it returns nothing... More specifically when I try the same view as a page the Contextual filter is working fine and filtering the content but when I try the view as a block nothing is returned although the "Provide default value" is set as "raw value from url". Any idea what might be the problem? By the way I tried the solution here but it's still not working https://drupal.stackexchange.com/questions/13868

How to add javascript library in Drupal 8 theme?

纵然是瞬间 提交于 2019-12-24 11:16:18
问题 I'm attempting to include a custom javascript file to manipulate my menu's in the Drupal 8 theme I am building. I followed the instructions in the Drupal 8 themeing guide, including it in my .info.yml file: #js libraries libraries: - dcf/base and defining it in my .libraries.yml file: base: version: 1.x js: js/endscripts.js dependencies: - core/drupal - core/underscore - core/backbone - core/jquery and finally creating a .theme file with a hook implementation (I'm not really a PHP developer,

Working with forms in Drupal 7

痴心易碎 提交于 2019-12-24 11:01:10
问题 I have nodes keeping a picture. There is a task to provide an ability to select a type and a size of the picture in every node for further downloading to the end user device. To do this, I want to attach a form under every node to allow user select a type and a size they need. After user select it and put submit-button I want to process user's request, to generate the picture they need on the server side and make somehow his browser to download it. But I have no idea how to achieve this

Drupal Views Relationships and Arguments

≡放荡痞女 提交于 2019-12-24 10:58:31
问题 I have a Person content type. It has a node reference field of a company which is also a content type. I then have a content type called Project. A project has a node reference to a company content type. I want to list all the projects related to a person id (nid) If I abstract this away from views and Drupal and each content type had it's own table I would use something like. Select ProjectName from Projects where CompanyID IN (select CompanyID from Perons where PersonID = 10) Can I do

Add subitem to second level

℡╲_俬逩灬. 提交于 2019-12-24 09:50:29
问题 I have primary links created manually. The are links to node (content type 'page') like -About --About Us --About company I need to add subitems About/About company/company1 and About/About company/company2 from my module. Next lines create menu item in first level (in one level with -About ) $items['about2'] = array( 'menu_name' => 'primary-links', 'title' => 'About2', 'page callback' => 'ninegm_about2', 'access callback' => TRUE, 'weight' => -10, ); 回答1: Check out the documentation at the

How to change results ordering for MySQL query?

岁酱吖の 提交于 2019-12-24 08:57:19
问题 I'm trying to get the previous and next node link/thumbnail for my pages and order the results according to their titles or file URIs or filenames... The code is querying the database and outputting previous and next node links according to node IDs (nid, n.nid). I want to order the results according to either node title (title, n.title), filename (filename, f.filename), or even file URI (uri, f.uri). However, when I change this line: ->orderBy('n.nid', $order) to: ->orderBy('n.title', $order

Why is ColorBox not loading properly?

不打扰是莪最后的温柔 提交于 2019-12-24 08:30:29
问题 The error I get is: $ is undefined Line 8 which is: $.colorbox({html:'<p>TEST TEST</p>'}); This is how the page renders: <script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?Y"></script> <script type="text/javascript" src="/misc/drupal.js?Y"></script> <script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?Y"></script> <script type="text/javascript" src="/sites/all/modules/extlink/extlink.js?Y"></script> <script type="text

Google Drive SDK: Empty array of files returned from Drive

隐身守侯 提交于 2019-12-24 07:59:40
问题 I'm having some trouble with Drive SDK. I am trying to get all files from my Google Drive account into my app. I feel like I am doing everything that the Drive SDK documentation tells me to do, but every time I go to grab files, I get an empty array returned ... and no errors. I'm using the SDK as a service account, so the set up is a bit different. My site is running drupal by the way. Here is my code: 1) first off, I build the service (this is the body of a function named buildService() :