• Hi,

    I’m currently using [related speaker][field title][/related] to pull in the names of the related field.

    Currently, if there is more than 1 related field, it outputs both but together like so https://cl.ly/0C3v362x293V

    It would be great to have space and a comma in there.

    Any suggestions?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @bannerpenguin,

    Not much people passing here, right? Less than on Slack…

    Not sure i understand clearly your issue, but maybe you just have to add the separator inside your CCS query, e.g.:

    [related speaker][field title] [/related]
    or
    [related speaker][field title] / [/related]

    See you 😉

    • This reply was modified 7 years, 10 months ago by studioavanti.
    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    The [related] shortcode loops for all related posts, so you can do something similar to what @studioavanti suggested.

    A useful technique is to show the separator after each post except for the last one:

    [related speaker][field title][if not last], [/if][/related]
    

    That will show “, ” between all posts.

    • This reply was modified 7 years, 9 months ago by Eliot Akira.
    • This reply was modified 7 years, 9 months ago by Eliot Akira.

    Rather refined option 😉
    Hi @miyarakira, it’s a pleasure and a relief to see you on this forum again.
    Your plugin is such a real life saver for intermediate coders… no sycophancy!

    Thread Starter bannerpenguin

    (@bannerpenguin)

    Hey Eliot,

    Thanks. That works for the comma but the ‘if not last’ statement isn’t working.
    Any advice?

    This is what I have;
    [related speaker][field title][if not last], [/if][/related]

    You can see this screenshot here that it’s outputting next to the last name – https://d.pr/i/wTkqk5

    Many Thanks,
    Adam

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Separating multiple related field results’ is closed to new replies.