I am trying to give 2 content types the same singular slug in bolt. both of them should have the same fields, and the same template. at this point i use the record_template: tag to set the default template for each content type.
vervolgpagina:
name: vervolgpagina
singular_slug: graszoden
singular_name: vervolg
fields:
titel:
type: text
class: large
group: Content
slug:
type: slug
uses: titel
group: Content
body:
type: html
height: 500px
group: Content
meta_keywords:
type: text
group: SEO
label: "Meta keywords"
meta_description:
type: textarea
height: 50px
group: SEO
label: "Meta description"
record_template: vervolgpagina.twig
graszoden:
name: graszoden
singular_slug: graszoden
singular_name: gras
fields:
titel:
type: text
class: large
group: Content
slug:
type: slug
uses: titel
group: Content
body:
type: html
height: 500px
group: Content
meta_keywords:
type: text
group: SEO
label: "Meta keywords"
meta_description:
type: textarea
height: 50px
group: SEO
label: "Meta description"
record_template: vervolgpagina.twig
so if i just put in one of the two content types and add a page to it then it
redirects me to /graszoden/vervolgpagina
so if i add the secont content type and add another page to it /graszoden/randomexample
what happends now. is that the page that worked just fine. says ERROR 404, and the other page gives me an bolt error with "No listing.twig file specified."
is there a way to show a content type twice in the cms with other names? Or is there a way to give two content types the same singular slug?
Thanx in advance,
No, you can't. If you have two contenttypes with the same slug and same fields, it should really just be one CT.
Perhaps what you might want is a "Grouping Taxonomy", see the example in taxonomy.yml for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With