Hi,
I am using CCK, Views and Location (http://drupal.org/project/location) modules.
I have created several content types with shared CCK fields and now I want to use Filters in Views2 to create search blocks that allow users to search content.
I want the users to be able to search content by User Roles, Keywords etc but for me is to allow users to search content by author's location.
I know I can add 'location' (Country, Province, City, Street, Postcode etc) to each content type and ask the authors to add their address every single time so that users can find them by location information in each article they post....but this is silly...what if the author wants to post 20 articles? are they supposed to type in their address 20 times? The authors should add their address(es) to their User Profile (I am using Content Profile module) only once....
I have been trying to figure this out myself and so far I have a feeling that Views2 Relationship is what I need but I do not know exactly how to set it up so that when user are searching for content (example: fun places in my city), they can also search by location information saved in another content type (let's say "user profile")
Has someone done something simlilar before? Please let me know if there are things that can be done...
Many thanks.
BB
Comments
Comment #1
blueblade commentedanyone?
Comment #2
tamasco commentedHello,
I have strugled to do just this until today. Thanks to the patch @ #87 http://drupal.org/node/321114#comment-1956538.
I used 6.x-3.1-rc1 and Gmap.
Cheers.
Comment #3
blueblade commentedThanks a lot Tamasco!! =D I will try that out now.
Comment #4
socialnicheguru commented#2,
Were you using cck location or node location? I can't get it to work with cck location.
Thanks!
Chris
Comment #5
tamasco commentedI'm using node location.
regards.
Comment #6
socialnicheguru commentedOk so this is still an issue for the original title of location CCK fields. Node based location is working.
So might I suggest changing the title to active for the original issue?
Chris
Comment #7
blueblade commentedHi tamasco and activelyOUT,
Thanks both of you saved me time =)
BB
Comment #8
blueblade commentedHi,
I think I have got it working!!
(I did install the patch from @ #87 http://drupal.org/node/321114#comment-1956538 but I am not sure if that is necessary)
Here's what I did:
Patch
0. Install patch from @ #87 http://drupal.org/node/321114#comment-1956538
CCK, Create Content
1. In the content type, create 'location' type field (country, province, city etc.) You can do this in 'Manage Fields' page.
-----
Views2, set Relationships
2. Under 'Relationships' in Views, click on + sign then select 'Node', then choose 'Content' from drop down menu
3. From the list of all fields you created for your content types, find the one you created in step 1 above
4. Under 'Label', type in a name
-------
Views2, set Filters
5. Under 'Filters' in Views, click + sign then select 'location', you can add 'country', 'province', 'city' etc
6. Go into each item (for example, 'country') then from 'Relationship' drop down menu, select the label name you created in step 4
7. I wanted the users to be able to select country, so I click on 'expose' and then update the view.
That's was it!! Let me know if you have other questions =) Good luck!!
Comment #9
nickl commentedNo response in 3 months, assuming problem solved.