Hi,
I am wandering about various bits of code in various packages and documentation... I'm looking for a smart/preferred way to store multiple values for a single attribute along with a content_type in the CR.
To be more concrete, what I'm doing specifically, is getting user input from a FORM
and then inserting it into the CR as a new revision of a specific content_type. This works great. I create the content type with content_type__create_type
and then I am able to generate a single SQL insert
statement to create my revision.
Until I add checkboxes to my form
. Then of course the multiple values for a single attribute blow my one-to-one mapping of attributes to table fields and my insert
breaks.
What I'm trying to figure out is should I just create my own table for multiple values and do a separate insert
"outside" of the CR API? Or is there a CR API for handling this situation that I'm just not seeing? Like I looked a photo-album package and the photos are created as a separate content_type in the CR and then related back to the photo_albums. This seems like a wacky way to handle multiple values from a checkbox: create a content_type for each attribute that could have multiple values (checkboxes)? Or create the checkbox attributes as generic storage attributes? I'm fumbling around here...
Can anyone else let me know how they handle storing multiple values for a single attribute in a content_type in the CR? If that is clear enough!