# Custom delineation with single || multi author

**URL:** <https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589>\
**Category:** Developer help\
**Created:** [June 13, 2018, 1:29am UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589 "2018-06-13T01:29:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![etanb](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/etanb/32/440_2.png) [@etanb](https://forum.ghost.org/u/etanb)\
**Post date:** [June 13, 2018, 1:29am UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589/1 "2018-06-13T01:29:46Z")

</div>

Version: 1.22.4

What’s the best way to do custom delineation in Ghost {{authors}}? We want to have the following:

By: Author One

By: Author One & Author Two

By: Author One, Author Two & Author Three

I’d assume that within an {{authors}} block you could find out if there’s only a single author by:  
{{#has author=“count:1”}}  
{{name}}  
{{else}}  
{{#foreach authors}}  
{{#if @first}}  
{{name}}  
{{else if @last}}  
& {{name}}  
{{else}}  
, {{name}}  
{{/if}}  
{{/foreach}}  
{{/has}}

However, nothing renders if there’s a single author. Any ideas?

My not ideal solution that works:  
{{#if author}}  
{{name}}  
{{/if}}  
{{#if authors}}  
{{#foreach authors}}  
{{#if @first}}  
{{name}}  
{{else if @last}}  
& {{name}}  
{{else}}  
, {{name}}  
{{/if}}  
{{/foreach}}  
{{/if}}

---

<div class="post-metadata">

**Author:** ![Aileen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/aileen/32/9846_2.png) [@Aileen](https://forum.ghost.org/u/Aileen)\
**Post date:** [June 13, 2018, 2:16am UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589/2 "2018-06-13T02:16:09Z")

</div>

Hey there 👋

Can you try this:

```auto
{{#has author="count:>1"}}
    {{!-- Multiple authors --}}
    {{#foreach authors}}
        {{#if @first}}
            {{name}}
        {{else if @last}}
            & {{name}}
        {{else}}
            , {{name}}
        {{/if}}
    {{/foreach}}
{{else}}
    {{!-- Single author --}}
    {{author}}
        {{name}}
    {{/author}}
{{/has}}

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![etanb](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/etanb/32/440_2.png) [@etanb](https://forum.ghost.org/u/etanb)\
**Post date:** [June 13, 2018, 6:25pm UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589/3 "2018-06-13T18:25:36Z")

</div>

That’s basically the inverse of what I initially tried which didn’t work.

Is there a way to, within the `{{#foreach authors}}` loop to see if index === authors.length or other more dynamic queries? Because then you can do interesting things.

---

<div class="post-metadata">

**Author:** ![Aileen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/aileen/32/9846_2.png) [@Aileen](https://forum.ghost.org/u/Aileen)\
**Post date:** [June 14, 2018, 4:10am UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589/4 "2018-06-14T04:10:51Z")

</div>

> [@etanb](#):
>
> However, nothing renders if there’s a single author. Any ideas?

Well, you were saying that nothing renders if there’s a single author, so I showed to the code how it’s used in our Casper theme (we use partials) where it works 100%.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [June 28, 2018, 4:10am UTC](https://forum.ghost.org/t/custom-delineation-with-single-multi-author/1589/5 "2018-06-28T04:10:54Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
