0

How would I approach this problem:

Background:

I have created a view that displays: Username, FirstName, LastName, Email

I have added a dropdown filter to the view display that enables the filter of users based on user terms (a user tagging module), Or interests.

That works all good.

The problem:

I now want to add a email group link at the top along side the filter drop down. This link is just an email mailto link that changes dynamically based on the fiter selection.

For example if a filter "A" is chosen and 2 people are displayed as having that tag, the email group link should include the Email address of those 2 people - pretty simple.

How do I go about adding this basic feature?

apaderno
  • 28,547
  • 16
  • 75
  • 90
  • In your view, is the 'row style' set to fields or node? Is the e-mail filled in together with the content type or is it saved somewhere else? – Jozzeh Jul 06 '10 at 07:38
  • Not sure it's fair to call this a "basic feature". Views already includes what is usually called "basic feature". Just saying. – danielson317 Jul 06 '15 at 20:17
  • Are you using ajax views or does the page refresh every time you apply the filter? – danielson317 Jul 06 '15 at 20:17

1 Answers1

0

To do something like this, would probably be easiest in a preprocess function. You only need to loop through all the rows and get all the email addresses, and create the mailto link from that.

You can use the l() function to create mailto links.

Community
  • 1
  • 1
googletorp
  • 33,075
  • 15
  • 67
  • 82
  • so are you saying use jquery? Is there a way to read query string to get current selected filter then build a db query based on that and render the link with the db results? – grimmersnee Jul 06 '10 at 21:18
  • @grimmersnee: googletorp is talking of PHP code, not JavaScript. – apaderno Jul 11 '10 at 15:05