1

I am using the Link module's link field. When I create a multi-valued field, it automatically adds a comma between them. I would like to remove this comma. For some other field types, such as term reference, I believe there is a way to set this in the UI, but I don't see this for the Link field.

2 Answers 2

1

My suggestion would be to modify the way the links are displaying using the Display Suite module's field templates. Field templates gives you a high level of control over all the ways Drupal outputs the fields.

I found this tutorial that is pretty in depth, but in short you want to add the Display Suite module, enable it and the "Display Suite Extras" module that comes with it.

Next go to the display suite settings and enable "Field Templates." This is under Structure > Display Suite > Extras.

Once those are enabled, find the display settings for your content type (Structure > Content Types > YOUR CONTENT TYPE > Manage Display.

On that page, in the vertical tabs at the bottom you'll see an option to set a layout. Select "One column" or "Reset". Selecting a basic layout here will enable the additional features Display Suite offers.

After your layout is set, you'll see many more options on each field for how it is displayed. You can set the field template to "Expert" and you'll get control of the wrappers, prefix and suffix content (i.e. comma or no comma), and a lot of other stuff.

Screen shot of field template expert options

I hope that points you in the correct direction. Play around with DS a bit and I think you'll really like the control it gives you.

1
  • I've never used this aspect of Display Suite Extras before and it looks interesting. However, it wont work in my situation. 1) For particular reasons, I'm displaying this view with fields and not Content, so I can't set a view mode 2) I installed the module and took a look at the settings on my field, and I don't see a way to set the separator for multi-valued fields. I'm going to try doing a preprocess on the field and see if I can target it that way. Commented Jun 1, 2015 at 13:13
1

I figured it out. I forgot that I wasn't using a display mode but a views field display. I found that on the field settings, it gave you the option of setting the separator, which was a comma by default. I removed the comma and my issue was solved.

1
  • This does not answer the original question, in cases where views is not used.
    – Yuri
    Commented Sep 2, 2017 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.