Extension, Fieldtype

Archived
Forum
(read-only)

Multi Relationships

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Denza

     

Trying to find a way to separate related entries with a comma

General

TJ Draper
TJ Draper

I want to separate related entries with a comma, but obviously don’t want to display a comma after the last related entry. The related_entries tag does not appear to support the backspace feature. Any help on this?

denza
# 1
Developer
denza

Hi, I think it could be done by writing plugin for this.

Could you describe the task - what do you want to achieve, what for to separate it with comma?

TJ Draper
# 2
TJ Draper

Let’s see if I can explain this.

I am going to be hosting a audio series/podcast that will have at least 2 hosts per episode. I will have a bio entry in a bio channel for each host and I want to be able to select 2 or 3 hosts in my audio channel with the Multi Relationships field. The HTML and template tags will look something like this:

{related_entries id=“bio”}<a href=”/bio/{url_title}”>{title}</a>{/related_entries}

I want to put a comma after the {title} on each instance expect the last instance. With categories, you can accomplish this with the backspace parameter. Can’t find a way to do it here yet.

denza
# 3
Developer
denza

I see, as a quick workaround try trimmer addon http://devot-ee.com/add-ons/trimmer

TJ Draper
# 4
TJ Draper

Trimmer is precisely what I was looking for. Works precisely as I need it to. Thanks!

denza
# 5
Developer
denza

You are welcome!