<p>Not sure if this can be done in the shorthand syntax, but you can do this using Twig for the dynamic title format. The key is to use <a href="https://twig.symfony.com/doc/3.x/filters/map.html" rel="nofollow noreferrer">map</a> to turn an array of entries into an array of titles and then <a href="https://twig.symfony.com/doc/3.x/filters/join.html" rel="nofollow noreferrer">join</a> them. Something like this should work:</p>
<pre><code>{{ object.movies.all()|map(movie =&gt; movie.title)|join(', ')|default('No movies selected') }}
</code></pre>
<p>Also note the <a href="https://twig.symfony.com/doc/3.x/filters/default.html" rel="nofollow noreferrer">default</a> filter, which is a nice fallback in case no entries are selected in your <code>movie</code> field.</p>

CC BY-SA 4.0
2021-05-07T18:44:57.067Z
It works!, the field is required but yes the default is a nice fallback.
user15280052
CC BY-SA 4.0
2021-05-07T07:51:22.670Z
2021-05-07T07:51:22.670Z
MoritzLost
<p>I have two sections <em>(both Channel type)</em>:</p>
<ul>
<li>Releases</li>
<li>Movies</li>
</ul>
<p><strong>Releases</strong> have one <strong>Entries field type</strong>, the source is <strong>Movies</strong></p>
<p>So, I want Auto-generate a <strong>Release</strong> title from <strong>Movies</strong>, like this: <strong>Titanic, Avatar, Toy Story</strong></p>
<p>This works <code>{ movies.one().title }</code> as a <strong>Title Format</strong> on the <strong>Releases</strong> Settings but display just the first movie: <strong>Titanic</strong>, the question is how can load all the entries titles? to get <strong>Titanic, Avatar, Toy Story</strong> as a title</p>
<p>I do a research and I get this: <a href="https://craftcms.stackexchange.com/questions/1689/how-can-i-set-an-entry-title-automatically-based-on-a-related-entry">How can I set an entry title automatically, based on a related entry?</a> but again that display only the first entry title.</p>

<entries><fieldtypes><titles><format><auto-generate>
How to Auto-generate a Title based on a multiple entries titles? (using a Entries field type)
# How to Auto-generate a Title based on a multiple entries titles? (using a Entries field type)

(Asked by: username_0 on 2021-05-06)

I have two sections *(both Channel type)*:

* Releases
* Movies

**Releases** have one **Entries field type**, the source is **Movies**

So, I want Auto-generate a **Release** title from **Movies**, like this: **Titanic, Avatar, Toy Story**

This works `{ movies.one().title }` as a **Title Format** on the **Releases** Settings but display just the first movie: **Titanic**, the question is how can load all the entries titles? to get **Titanic, Avatar, Toy Story** as a title

I do a research and I get this: [How can I set an entry title automatically, based on a related entry?](https://craftcms.stackexchange.com/questions/1689/how-can-i-set-an-entry-title-automatically-based-on-a-related-entry) but again that display only the first entry title.

**Tags:** entries, fieldtypes, titles, format, auto-generate


---

## 1 answers

### Answer by username_1 on 2021-05-07. Score: 1

Not sure if this can be done in the shorthand syntax, but you can do this using Twig for the dynamic title format. The key is to use map to turn an array of entries into an array of titles and then join them. Something like this should work:
{{ object.movies.all()|map(movie => movie.title)|join(', ')|default('No movies selected') }}

Also note the default filter, which is a nice fallback in case no entries are selected in your movie field.

> **Comments:**
> **username_0**: It works!, the field is required but yes the default is a nice fallback.  

---

