0

have allowed certain roles user pages to been seen by an anonymous user. I have then created a block that displays the latest post of the role user pages.

Is there a way in views to create a filter criteria from the get variable of the anonymous users URL

For example user/30 profile page is requested from the anonymous user. The view gets the id 30 from the url and then sorts the posts in the block view according to that users id

Below I have added some images on the view.

When an anonymous user accesses the authors user profile via the url it needs to display the content the author has created in the block view. The block itself only displays on the user pages by the use of user/* in the block configuration.

I hope this helps thanks again enter image description here enter image description here

  • 2
    You can use the Views Contextual Filters for that – Krishna Mohan Sep 3 '14 at 7:16
  • Thanks for the response I need a little more information please – purencool Sep 3 '14 at 7:43
  • Infact, I've prepared screenshots to post the answer. later I realized that the answer is too broad ;) So please provide the details like what you have tried? what you did? where did you stuck. Then it would be easy for us to post the answer :) – Krishna Mohan Sep 3 '14 at 7:48
  • I think you forgot to notify about your edit to me. anyway today I've posted an answer. Hope it helps – Krishna Mohan Sep 4 '14 at 8:46
  • np,If you feel my answer helpful, approve it. so that it would be helpful for future readers and also removed from unanswered list :) – Krishna Mohan Sep 5 '14 at 4:54
1

Here are the steps to achieve your requirement

Go to view and add contextual filter User: uid

enter image description here

Then select 'Provide default value' and select Type : 'Raw value from URL' and Path component: 2 (as URL is user/* .we select second component to get User ID)

enter image description here

That's it. I've tested this and working perfect.

Hope it helps.

| improve this answer | |
  • @purencool you are welcome.Glad to hear that. :) – Krishna Mohan Sep 5 '14 at 5:14

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.