Creating Custom Presets?

5 posts by 4 authors in: Forums > CMS Builder
Last Post: November 16, 2009   (RSS)

By (Deleted User) - November 4, 2009

If we wanted to how do create our own Custom Presets?

Re: [hegadmin] Creating Custom Presets?

By Luke - November 4, 2009

Hi hegadmin,

To create a CMS Builder preset do the following:

1. Log into CMS Builder and create a new section editor (Admin -> Section Editors -> Add New Editor). For this example we'll create a new Multi Record editor and enter in Articles as the Menu and Table Name. Click "Create New Menu".

2. Modify your new "Articles" section editor and add new fields as you see fit.

3. When done, on your server go to /cmsAdmin/data/schema folder and copy over your articles.ini.php file to your /cmsAdmin/data/schemaPresets folder. (Make sure you copy the schema file and not move it or else your initial table will disappear).

4. For new CMS Builder installations you can simply place the articles.ini.php file in the /cmsAdmin/data/schemaPresets folder and when creating a new section editor select "Articles" from the "select presets" drop down.

I hope this helps. If you have any questions please let me know.
Luke Holzken
Product Development

Re: [Luke] Creating Custom Presets?

By (Deleted User) - November 14, 2009

@Luke

By the ability to add preset is very nice and i will be using it a lot, but i have a question about it:

what are the options when creating a field in the preset. For example:

[userID]
order = 7
label = "User ID"
type = "textfield"
defaultValue = ""
description = ""
fieldWidth = ""
isPasswordField = 0
isRequired = 1
isUnique = 1
minLength = ""
maxLength = ""
charsetRule = ""
charset = ""


How would i make this field an integer field with a particular length and making it an auto_increment?

I guest the real question is, do you have a list of all the options available to create a field in a preset?

Cheers!

Re: [LeQueb] Creating Custom Presets?

By Dave - November 16, 2009

Hi LeQueb,

There's no user documentation for the fieldnames used in the schema datafiles.

That said, you can find a list of the fields and their default values in the php code at the top of /cmsAdmin/lib/menus/database/editField_functions.php

You can specify custom mysql column types through CMSB under: Admin > Section Editors > Your Section > Field Editor > Your Field > Advanced Options > MySQL Column Type

And this gets saved in the schema data file like this:
customColumnType = "INT"

And everything is hardcoded to use the 'num' fieldname as the default id field and have it be auto_increment.

Hope that helps! Let me know if you have any other questions. :)
Dave Edis - Senior Developer
interactivetools.com