Get staff members in a template

Hi,
In a custom template, i’d like to create a page to present a team. All members are created in the staff but it’s impossible to get all of them in the front.
This is what I did:

{{#get "authors"}}
        {{#foreach authors}}
           {{> "author-card"}}
        {{/foreach}}
    {{/get}}

Until a staff member hasn’t a related post, he is not an author and then cannot be fetched in the template. Is there someone who know how to fix ?

@gorjuce details of users with no posts are not public and so not available via the Content API. If you are trying to create a team roster perhaps you could create it manually as a page or a handlebars template where you have full control over the html?

@Kevin thank you for your feedback I appreciate it. Yes, I can create manually the page or simplier set my members as co-authors at least on 1 article to get them refered.
It solves my issue.

Please, please change this - even if you change the endpoint to “staff” or similar. It’s frustrating that I used to have this functionality and now it’s gone. It’s enough to make me not want to upgrade my Ghost install.

2 Likes

same for me

1 Like

Hi

This is my first project with Ghost CMS. I am using version 3.39.3.

I am currently using the Liebling theme.

The website we are building is for a long term project. In this project website, there will be page for team members. Some members of the team will contribute articles through regular blog posts.

If the authors page serves as the team page, showing all members (those with and without posts), the design will be neater.

I read in the forums that Ghost only shows authors who have made atleast one post. (Get staff members in a template)

Is there some place to modify this so that authors with no posts also show?

To be clear: Ghost’s author feature is not designed for building team pages, and this is a fun usecase - but not something that the product is intended to do.

That being said, there’s a pretty straightforward workaround that solves this:

  1. Create a page in Ghost called “Team” (or whatever you want)
  2. Create a template called page-team.hbs with your code to loop through authors
  3. Add each team member you want to show up on the team page, as an author of the team page.


Now every team member added to the page will have at least 1 published item, and there’s a logical way to add/remove team members from the page based on whether or not you’d like them to be there.

1 Like