How to get bundle machine name when viewing the creation form? From the creation form (any bundle), I need to get the content type label/name to use it in a link (in a block, for example) and pre-filter the View opened by this link.

Example :

The user wants to add a new Article and opens the Article creation form.

In a special block (let's say in Highlighted region), a link is displayed : "Clone existing".

This link leads to a View listing the existing Articles with a clone button for each.

This View can be filtered by content type.

So the link would be something like :

&lt;a href"/existing-nodes?type=[node:content-type]"&gt;Clone existing&lt;/a&gt;


How to get the [node:content-type] (just here to clarify, good old token) from the form?

Any tip would be nice.
Writing your own question is always useful.

I may have a solution, even if you may have something different, so please share.

I have built a Views block with a custom text (my link) as unique field (only show one result, you do not need to repeat the link, of course).

I have added a contextual filter based on content type with a default value provided by url, raw value, third component (node/add/mybundle_name), with case transform in lower case.

My link looks like :

&lt;a href="/existing-nodes?type={{ raw_arguments.type }}"&gt;Clone existing&lt;/a&gt;


And it works.