0

Using Views in Drupal 7, I have listed certain fields of profiles (eg. Name, Job) and then link each field to the relevant profile. Now I am wondering how to link the fields to the relevant profile. I appreciate your hints.

3

I assume you add Views for User listing:

  1. add "User: uid" field;
  2. exclude from showing;
  3. move to the top of field list (rearrange);
  4. Click on field, that you want to link with user profile.
  5. Expand: Rewrite results
  6. Check: Output this field as a link R
  7. In the bottom, find "Replacement patterns", user uid pattertn: [uid]
  8. Place it on "Link path" next text: user/[uid]
  9. Check that link appear.
| improve this answer | |
  • When I add user/[uid], or anything in [], to the 'Create Link' field the system just literally renders the string, not the corresponding number. – alfish May 21 '12 at 10:29
  • I assume it was intuitive thing, so I am add more details now. – Nikit May 21 '12 at 10:39
  • I'm not if I understand the question - as asked. They way I read it, the answer will not work. What needs to happen is to create a "Relationship". Once that is done, then fields that belong to the "Profile" will be available – sea26.2 Jul 5 '14 at 18:29
0
  1. Create a content view page the path must be user/%
  2. Go to Contextual filters and add Content: Author uid
  3. Configure Contextual filters and add Content: Author uid by doing the following
  4. In the Content: Author uid under (When the filter value is NOT in the URL) select Show "Page not found"
  5. In the Content: Author uid under (When the filter value IS in the URL or a default is provided) select Override title and in the field put user/%1
  6. In the Content: Author uid under (When the filter value IS in the URL or a default is provided) select (Specify validation criteria) and choose for Validator the option user
  7. In the Content: Author uid under (When the filter value IS in the URL or a default is provided) go to (Type of user filter value to allow) and select only allow numeric UIDs
  8. In the Content: Author uid under (When the filter value IS in the URL or a default is provided) go to (Action to take if filter value does not validate) and select Show "Page not found" and click apply.

Now go to relationships and add Content: Author (author) User: Profile make sure Content: Author is above (author) User: Profile otherwise you may get errors. Now that you have add the relationships you should be able to access all the user and profile fields including any other fields in views. This will allow you to customize that crappy default main profile page.

| improve this answer | |

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.