1

Here's a riddle:

I want to create a user profile page that will display some user info at the top (from Profile2) and a tabbed view of that user's nodes. Pretty similar to Twitter's profile page, with the only exception being that on the right side I want to put an exposed filter block so as to filter the contents of this view.

Sounds simple? It was simple in D6, but in D7 it's a mystery. In D7 in order to attach a view to user profile you have to use the EVA module, which does not allow for "Filters Exposed in Block" option. If you create an exposed filters block from the Master, it returns the default "all" argument even though you are on user/# page and theoretically passing the correct argument to the Views.

By contrast, exposing the filters inside EVA and placing them above the View works and passes the correct arguments, but then the profile page looks ugly.

So how does one resolve this riddle? How can I have a View on user-profile page and have a functioning Exposed Filters Block on the side?

0

Having exposed filters in a block is really only meant for page views.

There is a work around for creating a block view that will work with an exposed filters block at https://drupal.stackexchange.com/a/38994/10729 - Note also the comment below the answer, which talks about creating a custom module for the block, which is much better than using the PHP input filter if you don't mind making modules.

Then you can assign the block to show on the profile page.

A potential downside is that you cannot reorder the view via the profile fields display admin area like you can with EVA. This may or may not be an issue depending on wheere exactly you are positioning the view.

You could also instead print the block manually in your theme on that page exactly where you want it, or you could even put the views_embed_view() line directly in your theme and not worry about the block at all.

  • Thanks. But that's precisely the issue of my question. I did that and whenever I choose something from that side-block it returns the default "All" argument. And displays items from ALL users. – drupalina Oct 15 '13 at 2:10
  • Following those instructions works for my use case so I'm not sure I have any other useful ideas unfortunately. – rooby Oct 15 '13 at 2:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.