I have a content type called "Post" which contains two fields:

1) title 2) username

I created a View which creates a block that gathers all Posts. The block will reside on a user's account page, wherein the URL will always be: www.mysite.com/user/username

How can I filter that block to only show the results where the username field matches the second term in the URL?


1 Answer 1


Use contextual filter in views and set raw value as second argument from the url (here second argument will be username).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.