drupal-7

Same webserver, same drupal, same db, single sign on?

前提是你 提交于 2019-12-24 17:24:04
问题 I have a webserver with a drupal 7 installed on. Many primary domains are pointing to this webserver (es domain1.com, domain2.com) and each domain is see the same website. But if i log in into one (domain1.com) when i visit the domain2.com i'm not logged in. I know that is a domain cookie problem, but there is a way to generate the cookie for a list of domain when i register/log in? Hope that someone can help me 回答1: Here my module developed for getting a SSO system working with Drupal and

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

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

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

Drupal db_select PDO Statement: ORDER BY CASE

拜拜、爱过 提交于 2019-12-24 06:58:08
问题 Hi I have written a MySQL statement that has a conditional order by clause which you can see in the example below. MySQL Example: SELECT title, description FROM books WHERE title LIKE "%keyword%" OR description LIKE "%keyword%" ORDER BY CASE WHEN title LIKE "%keyword%" THEN 1 ELSE 2 END I am now trying to recreate this statement in Drupal using its PDO style db_select() function. But I have got stuck when writing the ORDER BY clause. Drupal Example: $node_select = db_select('node', 'n');

wkhtmltopdf style table of contents

你。 提交于 2019-12-24 06:11:28
问题 I'm wondering how i can go about reducing the font size on the generated table of contents. I've read and reread their documentation here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt The bit i'm confused on is: The generated XML document can be viewed by dumping it to a file using the --dump-outline switch. For example: wkhtmltopdf --dump-outline toc.xml http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf I'm having difficulty understanding how to translate to my own project, and what

wkhtmltopdf style table of contents

痞子三分冷 提交于 2019-12-24 06:11:00
问题 I'm wondering how i can go about reducing the font size on the generated table of contents. I've read and reread their documentation here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt The bit i'm confused on is: The generated XML document can be viewed by dumping it to a file using the --dump-outline switch. For example: wkhtmltopdf --dump-outline toc.xml http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf I'm having difficulty understanding how to translate to my own project, and what

Drupal 7 Forms API - AJAX Forms error: An illegal choice has been detected. Please contact the site administrator

旧城冷巷雨未停 提交于 2019-12-24 04:49:05
问题 I have a form set up where a users selects an item from a drop down. Once that item is selected another drop down is populated. Then depending on the value that is selected from the second drop down a fieldset may or may not be shown. If the field set is shown there is a field and a button. By clicking the button you add another copy of the same field. Once there is more than one a remove one button shows up as well. I got the basis for the code from here: http://api.drupal.org/api/examples

Drupal 7 Field API: how to programmatically send AJAX request specified in #ajax property of form element?

醉酒当歌 提交于 2019-12-24 03:35:12
问题 I'm using Drupal 7 field API to reload part of my form through AJAX. I have a button which makes the call but I would like to remove it and make the call programmatically as a response to a specific event. Here is my code for the AJAX button: $form['documents']['reload_document_list_button'] = array( '#type' => 'button', '#value' => 'Обновить список документов', '#ajax' => array( 'callback' => 'reload_document_list', 'wrapper' => 'document-list', 'method' => 'replace', ), ); (See http://api

How to put exposed filter in a separate block in a view in drupal 7

落爺英雄遲暮 提交于 2019-12-23 16:09:13
问题 With drupal 6 I could easily choose to have the exposed filters in a separate block which I could then put on the sidebar. I can't figure out how to do that in drupal 7. Anyone know? Thanks, Diana 回答1: Create a page view Adjust the settings Make sure you expand the advanced tab 回答2: For D7 blocks, setting 'Use AJAX' to Yes worked for me. Also, with two blocks on the same page filtering the same fields (but different data/views), it seems applying a filter from one block affects both blocks.