2

My searches have turned up nothing, I'm sure it is something simple but I can't figure it out.

To give a simple version of my set up: I have a content type for publications, that publication has a paragraph field for authors. That paragraph field accepts either a user linked by entity reference, or a non-user author (a set of text fields). My end goal is to display them in proper order like so:

Authors: Staff Author 1, Non-Staff Author 1, Non-Staff Author 2, Staff Author 2, Staff Author 3

Replacing the text there with actual author names. The order needs to be the order in which they were entered, which is the reason I am using paragraphs (I can mix types and keep the order)

Unfortunately the view options for the entity reference that work for the Users seem to be: Entity ID or Rendered Entity. Entity ID just gives me a number (which I'm sure I could then use in a preprocess function to load the user info and display it as desired -- if that is the best approach, please give me some guidance on where to start), Rendered Entity gives me a User Account full display including photo. I only want the name linked.

In How can I change a rendered user display to a combination of fields linking to the user? I got the answer about how to change user links, but how can I get this reference to show as a user link?

  • Are you using the paragraphs module? – No Sssweat Feb 29 '16 at 6:41
  • @nosssweat, yes, I guess I should make that more explicit in the question? – UltraBob Feb 29 '16 at 6:42
  • is your view a user view or a content view? – No Sssweat Feb 29 '16 at 6:45
  • It isn't a view, it is a standard node display, but it is of content, and I have the same issue when I view the node as the result of a view. If you weren't referring to the views module I apologize the terminology gets confusing. It is not a user view, I want the staff names to link to a user view. – UltraBob Feb 29 '16 at 6:48
  • That paragraph field accepts either a user linked by entity reference, or a non-user author how where you able to accomplish this, did you add two different fields to your paragraph bundle? – No Sssweat Feb 29 '16 at 7:25
1

how can I get this reference to show as a user link?

Go to your paragraph bundle and click on manage display. Find your entity reference field and click on the gear icon.

enter image description here

Note:

  • The label on the left it's the actual field label.
  • The label on the right, refers to the fields contents

Check-mark Link label to referenced entity.

enter image description here

  • That works, but I don't really understand why. I have it set as label hidden, then Format as label and link lavel to the entity. Is the meaning of Label different from the left side of the row to the right side? I would have expected this to show cool in your example. – UltraBob Feb 29 '16 at 7:45
  • @UltraBob the label on the left it's the actual field label, the label on the right, refers to the username. It's weird that they decided to use the word Label on the right. – No Sssweat Feb 29 '16 at 7:57
  • Yeah, that is extremely stupid. So label on the right refers to the short form of whatever the field contents are? – UltraBob Feb 29 '16 at 7:58
  • @UltraBob yuup. – No Sssweat Feb 29 '16 at 7:59
  • 1
    Thanks! That information would have made my life a lot easier for a couple of months now! – UltraBob Feb 29 '16 at 8:01

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.