0

I am trying to develop a basic job portal using Drupal 7. As you can see in the image below, I have an exposed filter as a block in the left sidebar, where visitors can filter by industries and job type.

What I'd like to do is modify that "Job & Internship Opportunities" title at the top based on the user's industry selection. So, for example, if the user chose consulting, the title would become "Job & Internship Opportunities: Consulting".

Any ideas how to accomplish this?

Screenshot of my job portal

Lukas Pleva
  • 381
  • 2
  • 5
  • 17

1 Answers1

0

If you want to update the title as people select different options on the fly then you'll need to use javascript (jQuery will be easiest).

Something like:

$('#industry-field').change(function(){
    $('.title').html('Job & Internship Opportunities '+$(this).val());
});

Or if you want to only update the title when the form is submitted then you can use drupal_set_title, possibly in hook_views_pre_render.

Felix Eve
  • 3,811
  • 3
  • 40
  • 50