drupal-7

Drupal Job board: Faceted Search with “OR” operator, but sort results by most matching facet criterias/term count

倖福魔咒の 提交于 2019-12-13 04:28:58
问题 I'm quite stuck with searching for a solution for my problem and I hope that you can maybe help me. In general I want to build a small job platform. It includes an "Explore"-Section, which is just like a Search-Page with Facets. The actual job-nodes can be tagged with terms of the two vocabulary "skills" and "interests". The facets on the search page allow the user to filter jobs exactly along these skills and interests. However, I want to use the "OR"-Operator for the Facets, so that the

Using Hook_form_alter on webform submitted values

泪湿孤枕 提交于 2019-12-13 03:56:52
问题 Drupal 7. Webforms 3.x. I am trying to modify a webform component value on submit. I made a custom module called 'mos' and added this code to it. function mos_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'webform_client_form_43') { dsm($form['#node']->{'webform'}['components']['1']); $form['#submit'][] = 'mos_contact_us_submit'; } } function mos_contact_us_submit($form, &$form_state) { $form['#node']->{'webform'}['components']['1'] = 'working@mos.com'; } However when I look at

Drupal 7 How to use render element instead of variables in hook_theme()

余生长醉 提交于 2019-12-13 03:55:46
问题 I'm having trouble understanding the 'render element' key purpose when implementing hook_theme(). function personal_news_theme($existing, $type, $theme, $path) { return array( 'teaser_list_by_user' => array( 'render element' => 'element', ), ); } I did my research and the way I understand it, the render element key is use when creating a theme function to modify another theme function's output ONLY! And there's no way to use it as to implement a new theme function. If I'm wrong, how can I use

Drupal preprocess a commerce function

谁说我不能喝 提交于 2019-12-13 03:13:37
问题 I need to preprocess a function from the module "commerce pricing attributes". Here is the function : function commerce_pricing_attributes_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {...} I don't know how to preprocess this (if it's possible). This function create some element in the back-office and the thing I want to do is to give a color to these elements in function of the type of the option the element is. If it's an insurance option

Loading views_accordion through an ajax request

故事扮演 提交于 2019-12-13 02:56:08
问题 I am currently loading my view through an ajax request in my custom module: $.getJSON('/reports/summarized-progress/get_output_activities/'+nid, null,activities); The drupal page for the above request returns the following: $output_arg=arg(3); $html=""; $activities=views_embed_view('activities','block_activities',$output_arg); //this returns a view accordion view if(!empty($activities)) { $html.=''; $html.=$activities; $html.=''; } drupal_json_output(array('data'=>$html)); The accordion

Owl Carousel not inline

情到浓时终转凉″ 提交于 2019-12-13 02:47:15
问题 I cannot seem to get owl carousel to work in drupal 7. I thought it might be a conflict with Chaos tools but now I'm not sure. I had zero issues with it functioning as expected in Drupal 8 but my client needs it in Drupal 7. I've tried it as a Block and as a Page. Currently, it stacks the content vertically instead of 3 inline as I hoped. Here is the working Drupal 8 link to show what I'd like to achieve: https://bryanbowers.me/cms/slideshow Here is the Drupal 7 version not working: https:/

IP address in HTTP_HOST

冷暖自知 提交于 2019-12-13 02:25:21
问题 I have a drupal site where I use the domain access module that works using inbound HTTP_HOST variable.I have to create some subdomain's also.To make this module work properly the $_SERVER['HTTP_HOST'] variable should have the domain name in it .But I am getting the ip address of our server.So my site is not working properly.I am getting the main site.But the subdomains are not working.All are pointing to the main site. My site is on our server and we asked our host to point our domain name to

Drupal Display Modified Date for Node

早过忘川 提交于 2019-12-12 18:55:59
问题 Is there a simple way in Drupal to display the last modified date for a node as part of the node.tpl.php file? 回答1: If you put this code in the node.tpl.php file it will show the date of the last change to the node: <?php echo format_date($node->changed); ?> with whatever HTML you want around it. 回答2: If you place below code in you node.tpl.php file - <?php $node = node_load($nid); echo $node->changed; ?> you will get the timestamp and i think that can be changed to date. Here $nid in tpl

NO_AUTO_CREATE_USER error while installing drupal-7

为君一笑 提交于 2019-12-12 11:13:19
问题 When I trying to install drupal-7 in my server, at the setup database step it shows the error Failed to connect to your database server. The server reports the following message: SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'. The database name, username, and password are all correct. Is there any solution to this problem? 回答1: Drupal isn't allowed to create a new user in your MySQL database. You need at least

How to theme a menu block in Drupal?

纵然是瞬间 提交于 2019-12-12 09:17:25
问题 This should really be a basic question but I simply don't get it after hours of searching. The question is, how do I theme menu blocks in Drupal 7? I've created three different blocks all based on the main menu. Now I want to: create unique HTML for all three blocks, that means modifing the surrounding wrapper and the <ul> and <li> that builds the menu. I wanna set special classes and remove all of the Drupal-added stuff attach different classes to the different levels within each block. One