Closed poznet closed 9 years ago
The setting you use depends on the table you want to use.
If you're writing to a ContentType table (called pages):
database:
contenttype: pages
If you're writing to a normal table:
database:
table: my_table
not quite i created new contenttype , and new table
database:
contenttype: rejestracja # Contenttype to create
table: bolt_rejestracja # Specific database table to write to
and even if i don't create these fields (slug etc) in content definition (in contenttype.yml) still seems that they are required ( error with database integrity - required not null etc) when you try to submit form
OK, what you might be missing here is the with the database
key, you only want 1 option, either contenttype
or table
. If you specify contenttype
it looks up the table for that ContentType, which gets created and populated by Bolt when you tell Bolt to update its database.
If you manually create the table
table, your fields must match the form, and you do not need datecreated
and friends.
Just thinking about it as I type, have you updated the database since creating the ContentType in app/config/contenttypes.yml
?
yep - that was the problem i had both options in database section and of course data was saved twice (with second insert there was error)
To get simple access (via cms) to saved data from form is to create new contenttype and bind form to contenttype
and next lame question (this time is more bolt than forms) : can i turn off(or hide) meta (dates,status etc) for specific contenttype (this connected to forms) in cms ( i simply don't need that info with content that comes from form )
Not turn it off as such… However, what I do on my sites is to use tabs in that ContentType, that way the unwanted stuff gets put in the "Meta" tab and kept out of the way.
that solves the problem ( in some way ) thx
Hello When i try to bind form with created contenttype it screams about database integrity
It seems that adding to database requires fields like slug,datecreated,datechanged,status
How to add values from form to contenttype(database) without creating those fields in form ?