TransWikia.com

User reference and Views 3 and Panels 3

Drupal Answers Asked on November 21, 2021

i have the follow installation:

  • Drupal 7.12
  • Views 3
  • Panels 3

I have an content type with the follow fields:

  • User name (textfield)
  • Job Function (textfield)
  • User reference (Reference Field)

I filled the content type with: Username: Test Job function: CEO, user reference: demo

I have 3 users at mom, admin, demo and normal

What I’m trying to do is when I change the User reference field on this content type to other user like, admin or normal:

It will update on the views page or panels page the nodes that this user has created

I have setup a View and put on the Contextual Filters: Author ID and pressed Apply (all display)

Then I created a panel page and Add a Content, selected Views and selected this view I created, then I have an option there called Author ID, and a select list that has this field called User Reference, I selected it and update and saved the panel

But when I visit the panel page, it does not show anything

The question is how can I do this that I’m trying to do?

One Answer

There are several things you can do to make your site work with Drupal a little better.

First, it is a bit unclear how you are using your user reference field. When I add the labels Admin and normal it sounds a bit like you are duplicating The users functionality already built-in. Go to admin/people and look at the definition of roles and permissions. It will allow you to define categories of users and assign them access to specific categories of content and activities on the site.

Next. Define your view to achieve what you want, ignoring the panel. 'Taming the Beast' at nodeone.se demonstrates doing exactly what you are looking to do. I recommend watching the entire series to understand exactly how Views works. Note that applying contextual filters can be a little tricky. I recommend you do not use path aliases when using them.

Only after you have your view displaying should you add the additional complexity of placing it in a panel. Once again, nodeone has an excellent series for understanding how panels works. Panels works closely with Page Manager and the videos show them working together.

Answered by Ashlar on November 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP