Score:1

How to display a user’s published content on their account?

mn flag

Does anyone know how to display every article (or content type) a user has published on their "my account" view? To clarify, I only want it to display that specific user's published content so that all users can click on a user and then see all of that particular user's published content.

What I currently have set up so far is my account/user's view page setup and displays the user's username and ALL published content. Still, it isn't filtered by the specific user's account/ content, only if the content is published or not.

I've tried adding different filters, but none have worked for me. I've also tried adding a "username of the content author" relationship, but that still won't do the trick. If it's helpful, the view's URL is /user/* (* representing a different number depending on which user's account view you are on)

Update: I installed pathauto module and changed the view's URLs to /user/[username] (so if your username is "human," the URL is now /user/human)

Mario Steinitz avatar
id flag
I'm somewhat in a hurry. "Advanced / Contextual Filters", then choosing the Author/User ID field should do it. It will automatically use the User ID from URL contextual filter.
ImagineSystem7 avatar
mn flag
@MarioSteinitz thank you for the reply, there were a few different variations of this filter and I tried them all but it’s still not working properly
No Sssweat avatar
ua flag
@ImagineSystem7 first we need to know what content your view is of. When you created the view in `/admin/structure/views/add` did you select "show: content" or "show: users"?
mx flag
The trick is to configure the contextual filter (of the author ID) to `Provide default value` and set that to `User ID from route context`. You can search this site with these terms to find a more detailed example with more steps.
Score:1
in flag

You are creating a view. Since you want it on the entity.user.canonical route, you need to create a block.

The view needs a contextual filter to use the user id from the URL path as a filter.

Next to Contextual filters click Add. Select 'Content: Authored By'. In When the filter is NOT in the URL select 'Provide default value'. Set Type to 'User Id from route context'

add a contextual filter to a view

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.