0

I created a content type named "Post" and allowed certain roles to add posts on my website.

I also created a view that displays these posts, as a page and block view. Now, I want to add a contextual filter to display posts from specific authors, but in filters I find only the author UID so that my URL is post/1 and so on. Is there a way to have user name instead of user ID as wildcard in the URL?

I also want to set the page title such as "Posts of [user-name]", but I don't know if it is possible to do.

I'm very sorry, but I googled for this but I found nothing.

2

You can add on "Relationships" (right side of your view edit page, under Advanced) "Content: Author". Now the name of the author (User: Name) will be available to you in fields and/or filters. You could also follow this: http://www.drupalden.co.uk/using-views-display-nodes-author-name

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.