drupal-6

Adding a JOIN statement in hook_views_query_alter()

烂漫一生 提交于 2020-02-24 08:54:21
问题 I need to modify a query Views generates so that I can use highly custom filters. I have implemented the add_where() function with some ORs thanks to this question: OR operator in Drupal View Filters However this only solves a part of my problem. There are some fields that I cannot filter on because I need to have extra JOINs in my query. Is there something along the lines of $view->query->add_where() that can insert JOIN statements? 回答1: Well, there is $view->query->add_table() and $view-

Measurement sheets in Drupal 6

人盡茶涼 提交于 2020-02-04 18:42:51
问题 I'm doing a project for a surveying company in Drupal 6. Ultimately, employees will need to enter measurements into a new content type. Currently they do it in a big Excel spreadsheet that has a bunch of macros to do calculations between cells (Meters to Feet, m^2, some pricing stuff). My question is: How would one go about replicating the functionality of this spreadsheet best in Drupal 6 , keeping in mind the amount of data the employees using this system gather varies between projects (I.e

Measurement sheets in Drupal 6

北城余情 提交于 2020-02-04 18:42:30
问题 I'm doing a project for a surveying company in Drupal 6. Ultimately, employees will need to enter measurements into a new content type. Currently they do it in a big Excel spreadsheet that has a bunch of macros to do calculations between cells (Meters to Feet, m^2, some pricing stuff). My question is: How would one go about replicating the functionality of this spreadsheet best in Drupal 6 , keeping in mind the amount of data the employees using this system gather varies between projects (I.e

Drupal: automatically add menu items when new nodes are added

被刻印的时光 ゝ 提交于 2020-01-23 07:06:52
问题 can I automatically add a menu item when I add a node to the page in Drupal? In other words, can I associate a menu parent with a node content-type, and then automatically add the children if new nodes are added ? thanks 回答1: Yes. I am sure there is a module do to something like that, but you could also create your own. There are two ways you could go about it. You could use hook_menu() to query for the items you want and return the correct menu structure. You would need to also make sure the

Drupal: automatically add menu items when new nodes are added

↘锁芯ラ 提交于 2020-01-23 07:04:05
问题 can I automatically add a menu item when I add a node to the page in Drupal? In other words, can I associate a menu parent with a node content-type, and then automatically add the children if new nodes are added ? thanks 回答1: Yes. I am sure there is a module do to something like that, but you could also create your own. There are two ways you could go about it. You could use hook_menu() to query for the items you want and return the correct menu structure. You would need to also make sure the

Drupal - Creating 'add another' buttons on node edit forms that will retain node relationships

流过昼夜 提交于 2020-01-16 19:25:06
问题 I'm attaching images to a content type - 'marketplace item' - using the node reference url widget. The technique is outlined in full here: http://drupal.org/node/599672 My goal is to add an extra button to the image node edit form that will allow users to save and add another image node, retaining the node references/relationships for this new image node . Therefore the buttons will be: [Save] [Add another image] [Preview] There are modules that provide 'add another' functionality (here and

Ignore “The” when sorting a View in Drupal

淺唱寂寞╮ 提交于 2020-01-15 05:09:06
问题 How can I ignore "The" when the user sorts a view in a Drupal site ? 回答1: Have you tried looking into the Views Natural Sort Module ? taken from module page linked above.. Provides a views filter that sorts titles by a more natural manner by ignoring articles like "The" and "A." 来源: https://stackoverflow.com/questions/3189092/ignore-the-when-sorting-a-view-in-drupal

Removing the navigation menu from the node menu settings in Drupal

江枫思渺然 提交于 2020-01-13 10:56:30
问题 How do you remove the "Navigation" menu (and others) from the menu settings on the node edit form? I suspect this can be achieved somehow using a hook like module_form_alter, but am not sure how to implement it. The motivation for this is to remove the confusion our users have when menus other than the standard primary links menu is in the drop down. The aim is to restrict the options to just the menus they will need/want to post content to. This question is in part related to an earlier

How to create a forum topic programmatically?

烈酒焚心 提交于 2020-01-12 10:39:50
问题 I just gone through how to create forums and containers programmatically with the below link http://www.unibia.com/unibianet/drupal/how-create-drupal-forums-and-containers-programmatically But never see any post(google) which create forum topic pro-grammatically, whether i should go with node_save() or any alternative. please help me guys, Thanks, Edvin 回答1: A quick, safe and easy way to create new nodes programmatically is to use node_save(): <?php // Construct the new node object. $node =

Drupal multisite setup

◇◆丶佛笑我妖孽 提交于 2020-01-11 12:58:07
问题 I am trying to setup drupal to host multiple sites which will not effect each other. My pages are hosted on a shared hosting service and I only have access to cPanel. Following the instructions on the web that I found using google, I have done the following. Installed Drupal. Make a directory in sites and name it demo.sharedhost.com. Copied default.settings.php in that directory and renamed it settings.php. Created a subdomain demo. Deleted the demo folder from public_html Made sybolic link