drupal-6

Include templates based on current language with drupal

那年仲夏 提交于 2019-12-11 07:35:09
问题 I'm looking for a fast way to display a particular template file based on the current language of the page. Let's say I have two languages : english and french (english being the default) I have various templates files, like : page.tpl.php page-node-11.tpl.php in my theme directory. I'd like to find out a way to include these files based on the current languages; so for example if the current language is 'english', it will include 'page.tpl.php', if the current language is 'french' it will

Calling script on image upload in Drupal

℡╲_俬逩灬. 提交于 2019-12-11 07:32:22
问题 I would like to call a Ruby script when a user uploads an image to my Drupal content-type. I have a CCK image field that serves as the main image, and ImageCache takes care of resizing and creating thumbnails for me. I have a Ruby script that does some transformations to the image, however I don't exactly know how to call it (no experience with Ruby really). Basically the script applies some image transforms and then generates a new image. My question is how to call this script from Drupal..

how to override $block->content in drupal?

丶灬走出姿态 提交于 2019-12-11 06:55:54
问题 Now, if i want to override the $block->content which is generated by the Book module... how can I override it and customize the title list? thank you. 回答1: You can use the preprocess_block function function phptemplate_preprocess_block(&$vars) { if (isset($vars['block'])) { print_r($vars); } } And dig into those results. About the content, is this is a module generated block, I hope that $content is renderer using a theme() function, so you just need to alter it. 回答2: The $vars argument will

drupal views facebook like button

亡梦爱人 提交于 2019-12-11 06:55:11
问题 I tried to add facebook like button to my veiws, which lists a particular node-type. I used views custom field module to add the iframe code. The problem is when I click like.. it shows Nikhil liked http://example.com/node/44 instead it should have shown Nikhil liked node title on example.com . Where am I going wrong. 回答1: Use Open Graph tags: http://developers.facebook.com/docs/reference/plugins/like 回答2: oK , well I was able to achieve the above feature by following methods: Created a cck

conflict between views and pathauto

喜你入骨 提交于 2019-12-11 06:38:01
问题 if i create a path alias to a node, say 'press' and i have a view page display on path 'press/archives', why does 'press/archive' leads my users to 'press'? see related Fundamental understanding of how Views and Pathauto work together 回答1: A way around this is to make a custom view with page URL "press" that only retrieves the one node and shows the full node content, so that the URL token is handled by Views and not by the menu system. 来源: https://stackoverflow.com/questions/2914222/conflict

Drupal Site install on localhost after downloading source using FTP

早过忘川 提交于 2019-12-11 05:53:21
问题 I've been working on a Drupal site and pretty much know how to install Drupal on the localhost. But when I downloaded the existing source code from the main site to my system ( using FTP ), I am unable to install the site inspite of changing the database url in the settings.php file. Also, when I run localhost/site/install, I am able to complete the installation but when I view the existing site ( localhost/site ) I am not able to see any content. I am using Ubuntu 12.04 and Druapl 6.x. Any

Two forms on the same page drupal

半城伤御伤魂 提交于 2019-12-11 04:48:52
问题 I have a database of clients. Before entering a new client, I want to make sure that that client is not already in the database. So I want to put a search form at the top of my page to search by client number, and client name. Further down the page, I'll have another form to enter and submit the client's information. Would this be the best way to go about something like this? How would you approach this? i'm using drupal 6. 回答1: It is better that when the user is inserting a new customer name

Suggesting different templates when theming a node form

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:41:22
问题 function posts_theme($existing, $type, $theme, $path) { return array( 'post_node_form' => array( 'arguments' => array('form' => NULL), 'template' => VARIABLE, ) ); } This is the way of suggesting a template to render the 'post_node_form' in Drupal 6. BUT I want to get the node editing form from 2 different paths: via AJAX through drupal_get_form('post_node_form') via default node/add/post If I replace "VARIABLE" depending on the path (or whatever other condition), it will not work because it

Hide Drupal nodes from search

人走茶凉 提交于 2019-12-11 03:28:14
问题 I made a private section on a drupal site by writing a module that checks the RERQUEST_URI for the section as well as user role. The issue I am running into now is how to prevent those nodes/views from appearing in the search. The content types used in the private section are used in other places in the site. What's the best way to get Druapl search to ignore the content/not index/not display it in search results? 回答1: There is a wonderful article that explains just this on the lullabot site.

How to register a user to Drupal 6.x without using the API?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 02:27:35
问题 We have to have a "register" method available via web service that is written in java so hence forth we do not have access to the Drupal API. But we need to be able to register a user successfully. Simply adding a user to the users table will not do it as the newly created users are never able to login successfully. Again I love the Drupal API and would always use that as that is the "correct" way to do it but in this case we just dont have the faculty to do that. Any insights to this dilemma