I need a views filter for the current logged in user, to allow the filtering of content based on their country, and possibly other location information stored. I have read this is possible through the distance filter, however I found this problematic as it is based on a fixed distance, leading potential users viewing incorrect information, i.e. if they were on the border of a country.

I have hacked together (and it is in no way suitable for launch) a new views filter to allow me to manage just the user country aspect and it works fine. I'm going to investigate converting this into a stand alone module to extend the existing views location filters. I've seen a few people asking for similar features and fucntionality so this message is more information gathering, so I can attempt to gauge everyones requirements before I start writing the component.

My requirement was to simply filter content based on the logged in users country only.

Add your ideas below.

Comments

darrellduane’s picture

I also would like to have a views filter based on the logged in user. However, I just need a way to set the filter to constrain the records returned WHERE field_registrant = UID of the logged in user. I've got to believe there is an easy way to do this but I'm still searching.

Jarada’s picture

To filter by the currently logged in user, use the filter User: Current in the Views filters.

kenorb’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Issue summary: View changes
kenorb’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Active » Closed (works as designed)

It's 4 years old, please re-open if required.