Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content Type's in bolt

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,

like image 476
B. Dionys Avatar asked Dec 19 '25 00:12

B. Dionys


1 Answers

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.

like image 80
Bopp Avatar answered Dec 20 '25 16:12

Bopp