docs icon indicating copy to clipboard operation
docs copied to clipboard

Update with instructions on how to use options like "description" and fields in content types.

Open irro opened this issue 9 years ago • 2 comments

The documentation should be updated to explain how to use all of the different fields like "description". I can't find anything in the documentation that explains it and every way I try to use it as a field in contenttypes.yml creates an error when I try to check my database.

The list is here: https://docs.bolt.cm/contenttypes-and-records And on the cheat sheet.

Two of the ways I've tried are contenttype.yml usage as:

    name: Apps
    singular_name: Appitem
    fields:
        description: "Useful applications for people with Mast Cell Disease."
        title: 
            type: text
            class: large

or

    name: Apps
    singular_name: Appitem
    description: Useful applications for people with Mast Cell Disease.
    fields:

The error is generally this: In the contenttype for 'Appitem', the field 'description' has 'type: ', which is not a proper field type. Please edit contenttypes.yml, and correct this.

Fields

Simple instructions such as how to use multiple text fields in the same content type should be added. I thought every field that I wanted to be a :text just needed a different label to be pulled into the records.twig template. Online I was told that every one needed a new ID, but I'm still not sure this is correct because every field that doesn't have the ID "text" is pulled into the template differently. The front end will only show their ID string and content.

My example is:

            type: html
            height: 300px
        text2:
            type: text
        text3:
            type: text

Text 2 and 3 are shown on the front end as:

text2: Text2 Content

text3: Text3 Content

There should be something that says "To edit the way extra fields are shown on the front end please follow this link..."

I can write this myself for use if I could figure out how to do it. But I can't find it in the documentation and I've gone over it many times. If I'm missing something important I'm really sorry, but I've tried finding and searching.

irro avatar Nov 23 '15 00:11 irro

With the description that itself is a ContentType properly not a field property, and I am not even sure we use it any longer… @bobdenotter?

With the field question you can have multiple fields of the same type, and they do require a unique ID… but what might have gotten lost in translation on IRC was what is an ID :grin:

So in this example, title, slug, name, breed and colour are all field IDs

kittens:
    name: Kittens
    singular_name: Kiten
    description: Something something darkside
    fields:
        title:
            type: text
        slug:
            type: slug
            uses: title
        name:
            type: text
        breed:
            type: text
        colour:
            type: text

GwendolenLynch avatar Nov 23 '15 03:11 GwendolenLynch

Well, description is still working as expected in master, and is quite useful so I hope it sticks around.

Still, having the showcases example have the keys be a bit less tied to the types might give a stronger indicator and also expanding the example in https://docs.bolt.cm/contenttypes-and-records might help...

SvanteRichter avatar Nov 23 '15 21:11 SvanteRichter