I am trying to use this hook function in order to get the min/max values from the database. As I am no coder I am facing some trouble with this. Here's my approach:

At first I recognized that I don't have an own template.php in my subtheme folder. I copy pasted the original one in my subtheme folder and adjusted the name "bartik" everywhere into "new" (which is the name of my subtheme). Then I put the code in my template.php and changed "hook" into "new". Then I changed 'field_price_value' into 'field_size' (which is one of my fields). Just for checking I set the min and max values different from the BEF settings. I cleared all caches and refreshed my website but the min/max values didn't change. The original values from the BEF settings are still shown?

Does somebody see a mistake in this approach or what could cause this problem?

Thanks for any help in advance.

This is my code:

function new_better_exposed_filters_settings_alter(&$settings) {
  $settings['field_price']['slider_options']['bef_slider_min'] = 200;
  $settings['field_price']['slider_options']['bef_slider_max'] = 250000;
  • Try posting the actual code, not just an explanation of the changes to someone elses code. If you don't have it, get Devel Module, and use dpm($settings) in the function. It could be that post refers to a different version (or a patch has been made that changes things slightly). Work through the output dpm to make sure the array structure is correct. – Geoff Jun 13 '14 at 19:37
  • alright, I posted the code in my question now. Thanks. – ThuleNB Jun 14 '14 at 13:16
  • what did dpm show - were you able to trace the field and check the array structure – Geoff Jun 14 '14 at 13:28
  • sorry, I have no php skills and never worked with Devel Module. Maybe I first have to get all this to accomplish such a database request. – ThuleNB Jun 14 '14 at 13:41
  • learn as you go :) download Devel(drupal.org/project/devel) install Devel only. In that same function, prior to the those changes, write dpm($settings); this will cause devel to show the array $settings on your page (yellow box with ...(Array .. elements). Click on that - it works like a file manager but you are working your way through the array like a folder structure. follow it down in the order listed (look for field_price, and under that slider_options, etc. Try to find the last setting and make sure the spelling of each level is correct – Geoff Jun 14 '14 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.