I would like to create extended attributes for the user object like geo-location and then use those attributes to limit content that is shown to the user. For example, in blogs posts, only show blogs that are related the user's location.
How will you correlate the blog posts to each location? Also, will you try apply this filter to search and all the different types of widgets where blog posts are rendered?
What I would like to do is have the same custom attribute applied to both as a common attribute. Then, it would be used in multiple content areas.
There are two distinct parts to your probablem here - the first is storing this additional meta data on content (E.g. geolocation for posts & users). Using that data is a totally different questions, and ultimately dictates how you store that data.
For the storage part, extended attribute may appear to work at first, but they'll almost certainly break down when you come to use them - in particular there are not sorting or filtering capabilities around extended attributes. Extended Attributes are simply a key/value store on various (but not all) entities. Nothing more, nothing less.
There is a content meta data extension at https://github.com/RichMercer/ContentMetadata which solves many of these problems, but I'm still not sure it's going to help as it's not clear what your filtering requirements actually are. If you have more elaborate filtering options, then you're probably best looking at storing data in a custom data store better tuned to your needs.
Depending on exactly what you're doing, then tags may be a solution to your filtering problem - if you want to filter by location for example, you could tag content with the relevant location, then you can easily retrieve all content tagged with that location. At the very least it's probably a good way to prototype various filtering options, and see if they actually work in practise before building something more bespoke.
I would not use tagging for geolocation, geolocation is way too precise and without customizations tagging is not controlled, it can be easily manipulated or altered from the UI. Storing a latitude and longitude as an attribute on a user should not really be an issue, it should be secured like any other profile field.For blog posts however, I would create a custom table if you need to query.
Sorry for the late reply. I was not thinking exact geo-location. I have several different sites in my company across the country. For example, I would like to have users in Ohio (that are flagged as Ohio in their profile) only see blogs for their region.
Powered by Telligent Community