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
|
Posted: 29 May 2012 01:33 AM |
|
|
|
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
|
Posted: 29 May 2012 01:37 AM |
# 1
|
|
Developer
|
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
|
Posted: 29 May 2012 01:51 AM |
# 2
|
|
|
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
|
Posted: 29 May 2012 02:03 AM |
# 3
|
|
Developer
|
I see, as a quick workaround try trimmer addon http://devot-ee.com/add-ons/trimmer
|
|
|
TJ Draper
|
Posted: 29 May 2012 02:21 AM |
# 4
|
|
|
Trimmer is precisely what I was looking for. Works precisely as I need it to. Thanks!
|
|
|
denza
|
Posted: 29 May 2012 03:08 AM |
# 5
|
|
Developer
|
You are welcome!
|
|
|