1

I'm using D7. I have a custom content type that I need to relate to the user. The user will set up and maintain this page themselves. i.e. Each user has one page of content for this content type.

When a user profile is viewed though I need to show the relevant page that relates to the the user.

What's the best way of doing this in D7? I'm guessing it's something to do with creating a block view and then using contextual filters. I've managed to get a block view that does this within the preview but I can't get any further than that in terms of linking it to a user profile.

There is the possibility of linking the user name to the content title. In fact if the two were intrinsically linked it would be better. Ideally I would have used the profile 2 module but I'm using location ( doesn't work with users in D7 ) and FiveStar ( doesn't work with users in D7 ).

Any suggestions on where to start looking to solve this would be appreciated.

1

Have a look at the Profile 2 module. It replaces the Content Profile module from Drupal 6 and the profile module that is build into Drupal Core.

| improve this answer | |
  • Hi Oswald, Thanks for the answer. I have got Profile 2 installed but a couple of the features I'm looking to implement - 5 star rating of this page and geolocation proximity search don't work with user profiles from what I've read. Unless somebody knows differently. – user2324 Aug 5 '11 at 8:50
0

You could create a node reference on the profile and populate it with an empty node, when the profile is created. Then it's just a matter of theming when it comes to displaying that node on the profile page.

| improve this answer | |
  • Thanks for the answer, I've actually solved this. I'll post how I did it. – user2324 Aug 8 '11 at 8:44
0

I've managed to solve this. Here's how I did it.

In Advanced settings:

First, I created a relationship in the view to link the content to the user profile. This was achieved by selecting content:author.

Next I created a contextual filter using this relationship on user:id.

On Page Settings:

I then set the path up to be user/%/content, this allows the user page to bring up the relevant content that the user has posted.

Finally, I created a menu tab on the user menu.

Job done!

Next I need to find a way to ensure that each user can only create one page of the relevant content. Any suggestions?

| improve this answer | |
  • if this is your chosen solution, please mark the answer as accepted for future visitors. – Laxman13 Sep 7 '11 at 14:01

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.