I asked this over on the Drupal.org forum, but I thought I'd give it a try here too.
I am using an taxonomy entity reference field to display author names on our site. I added a 'published_name' field and referenced it to the Author taxonomy. What I'd like to do is make a custom user profile twig that shows that entity reference field value on the author's profile page, including it's link, so when the displayed name is clicked, it shows all the books connected to that author.
I made two different profile types using the Profile Module. Everyone gets a Public Profile, and the authors get a second one just for their custom information. The Writer Profile (machine name writer_profile) is the one with the field 'field_published_name'.
On the writer's profile page, In the manage display of admin/config/people/profile-types/manage/writer_profile, I added the Published name field, I set it as Format: Label; Link to the referenced entity. The field does show, and work when clicked on the User page, but I can't control where, and how, it looks without using a twig. I want to customize when, where, and how it would be displayed on the page.
I have tried in the user.html.twig:
{% for item in items %}
{{ item.content['#user'].field_published_name.value }}
{% endfor %}
Also:
<article{{ attributes.addClass('profile') }}>
{% if content %}
{{- content.field_published_name -}}
{% endif %}
</article>
On admin/config/people/accounts/display I have it set to show the 'Public Profile profiles' and 'Writer Profile profiles' format as Rendered entity.
So far it just comes up empty while showing the rest of the user's info on their profile page.