I don't know how Calipso form language works. Site calip.so down #185

Closed
chesnel opened this Issue Jan 12, 2013 · 21 comments

Comments

Projects
None yet
4 participants

chesnel commented Jan 12, 2013

Hello,

I'm try to create a simple content types and I wan't add custom fields, unfortunately the website with the website calip.so is down and it's impossible to find the way to do. Is it possible to put an example ? because I turn around... Perhaps it would be interesting to add to the wiki on github ?

Merci beaucoup de votre aide :)

Collaborator

richtera commented Jan 12, 2013

Do you want to just modify the content fields or are you thinking your type of item is completely different from normal content?
Thanks
Andy

On Jan 12, 2013, at 4:43 PM, chesnel notifications@github.com wrote:

Hello,

I'm try to create a simple content types and I wan't add custom fields, unfortunately the website with the website calip.so is down and it's impossible to find the way to do. Is it possible to put an example ? because I turn around... Perhaps it would be interesting to add to the wiki on github ?

Merci beaucoup de votre aide :)


Reply to this email directly or view it on GitHub.

chesnel commented Jan 12, 2013

I want to create custom fields in my new content types, not modify fields already existing. Example : add input text, checkbox or dropdown.

Collaborator

richtera commented Jan 12, 2013

Do these fields show up for an admin only or do you want to present these
input fields as part of the content?
Andy

Sent via the internets

On Jan 12, 2013, at 6:04 PM, chesnel notifications@github.com wrote:

I want to create custom fields in my new content types, not modify fields
already existing. Example : add input text, checkbox or dropdown.


Reply to this email directly or view it on
GitHubhttps://github.com/cliftonc/calipso/issues/185#issuecomment-12186141.

chesnel commented Jan 12, 2013

I just want to know the syntax for this part :
Capture d e cran 2013-01-12 a 18 23 38
there is nowhere where you can have different example?

Collaborator

richtera commented Jan 12, 2013

Got it. The forms are driven by a json structure. In order to create custom
fields you could copy the code for the content module and modify the form
json. But then you content module would be separate from the distribution.
It might make sense to come up with some specific extension point to add
fields to existing module storage, like users, content and so on. We should
talk about it.
Andy

Sent via the internets

On Jan 12, 2013, at 6:25 PM, chesnel notifications@github.com wrote:

I just want to know the syntax for this part :
[image: Capture d e cran 2013-01-12 a 18 23
38]https://f.cloud.github.com/assets/1634411/62420/2540b4a4-5d0f-11e2-8746-5bec57f44770.png
there is nowhere where you can have different example?


Reply to this email directly or view it on
GitHubhttps://github.com/cliftonc/calipso/issues/185#issuecomment-12186363.

chesnel commented Jan 13, 2013

Ok, I find in contentTypes.js example for format json, but unfortunately it's not work... : I have a message : No - Unexpected token l

{
label:'Content Type',
name:'contentType[contentType]',
type:'text',
description:'Enter the name of the content type, it must be unique.'
},
{
label:'Description',
name:'contentType[description]',
type:'text',
description:'Enter a description.'
}

Collaborator

richtera commented Jan 13, 2013

Could you send the whole file? It's hard to tell otherwise. You'll also
want to add the field to the schema
Andy

Sent from my iPhone

On Jan 12, 2013, at 7:21 PM, chesnel notifications@github.com wrote:

Ok, I find in contentTypes.js example for format json, but unfortunately
it's not work... : I have a message : No - Unexpected token l

{
label:'Content Type',
name:'contentType[contentType]',
type:'text',
description:'Enter the name of the content type, it must be unique.'
},
{
label:'Description',
name:'contentType[description]',
type:'text',
description:'Enter a description.'
}


Reply to this email directly or view it on
GitHubhttps://github.com/cliftonc/calipso/issues/185#issuecomment-12187393.

chesnel commented Jan 13, 2013

mmh ... it is not a file. I put the piece of code in the field that I showed in the picture before. I think I have not explained well what I want to understand ... I'm note really good with my english : /

Collaborator

richtera commented Jan 13, 2013

Ok, the easiest way to start would be to copy the folder
modules/core/contentType to modules/community/myContentType
Go to your admin page and enable the module. Then forcefully disable the
original contenttype module by changing the conf/development.json file and
set enable to false for the original contentType (the ui doesn't allow some
modules to be disabled.) then you can change your new module. Now this is
not the perfect way to do this because you now have a separate 'core'
module, but there is not standard way to extend schema on core modules. I
think this might be a good addition to the platform. But doing the steps I
just mentioned will work until you need to do a major upgrade where
contentType in the core has major changes
Thanks
Andy

Sent from my iPhone

On Jan 12, 2013, at 9:25 PM, chesnel notifications@github.com wrote:

mmh ... it is not a file. I put the piece of code in the field that I
showed in the picture before. I think I have not explained well what I want
to understand ... I'm note really good with my english : /


Reply to this email directly or view it on
GitHubhttps://github.com/cliftonc/calipso/issues/185#issuecomment-12188563.

chesnel commented Feb 27, 2013

I'm don't understand...sorry.. but I don't wan't to create a new module. I just want to add new field in content types with the interface (on screenshot above). I try different format json. I'm start with this :

{id:'content-form',title:'Create Content ...',type:'form',method:'POST',action:'/content',tabs:true,
          sections:[{
            id:'form-section-content',
            label:'Content',
            fields:[
                    {label:'Title',name:'content[title]',type:'text',description:'Title to appear for this piece of content.'},
                    {label:'Teaser',name:'content[teaser]',type:'textarea',description:'Enter some short text that describes the content, appears in lists.'},
                    {label:'Content',name:'content[content]',type:'textarea',description:'Enter the full content text.'}
                   ]
          }
}

but I have always the error : No - Unexpected Token I (sometimes it's a S...)

You aren't alone on this. No idea what they mean, and the "help below" is absent. O_o

Contributor

arosboro commented Apr 29, 2013

I think work needs to go into custom content types to allow you to define your own fields without writing code. I'll investigate this when I have some time.

Collaborator

richtera commented Jun 25, 2013

I agree that we need to either add or improve the way to add custom types or extend existing types without writing new modules. I am investigating this as well. Let me know if anyone would like to put ideas together.

Collaborator

richtera commented Jul 21, 2013

Here is an example of the form:

{"fields":[
  {"label":"Something", "name":"isCool", "type":"hidden", "description":"Is this really cool? Can't really see this"}
],"sections":[
  {"label":"Hello","fields":[
    {"label":"Cool?", "name":"content[isHelloCool]", "type":"checkbox", "description":"Is this really cool?"},
    {"label":"Cool Name", "name":"content[coolHelloName]", "type":"text", "description":"What's the cool name?"}
  ]}
]}

It turns out everything has to be full JSON (so all attribute names need to be quoted.)
There is a fields property and a sections property. Both contain arrays.
Looking for more docs.

Contributor

arosboro commented Aug 21, 2013

The content type form is defined at line 152 of modules/core/contentTypes/contentTypes.js

152 /**
153  * Content type create / edit form
154  */
155 var contentTypeForm = {

In various callbacks it has the title and action property modified.

It gets rendered in several router callbacks like path:'GET /content/type/edit/:id' editContentTypeForm()

272       calipso.form.render(contentTypeForm, values, req, function (form) {
273         calipso.theme.renderItem(req, res, form, block, {}, next);
274       });

I'd like to conceptualize and implement a field ui module and field modules to handle creation of sections and fields. The field ui module would provide fields for labeling, naming and selecting a type of field, then the field modules would provide a list of field implementations with their own settings. Filling out the form would generate correct calipso form language for custom field json.

It would help if form language had some sort of callback mechanism for validation and or ajax. Maybe the first step should be revamping calipso form language.

Contributor

arosboro commented Aug 24, 2013

I found a way to alter the ContentType form and started adding a ui for fields. It's pretty clunky but I thought it could spark some discussion. I just rendered the field, I'm not looking at form submissions yet.

edit: I cleaned it up a little bit.
clean slate 2

Contributor

arosboro commented Aug 25, 2013

Can somebody look over https://github.com/arosboro/calipso/compare/issue%23185_calipso_form_generator

Sorry, I accidently included a commit from a previous pull request (forgot to branch off of master). It's a very basic interface and I'm not sure if it introduces IO blockers.

Collaborator

richtera commented Aug 25, 2013

On vacation... Will check

Sent from my iPhone

On Aug 25, 2013, at 11:10 AM, Andrew Rosborough notifications@github.com
wrote:

Can somebody look over
https://github.com/arosboro/calipso/compare/issue%23185_calipso_form_generator

Sorry, I accidently included a commit from a previous pull request (forgot
to branch off of master). It's a very basic interface and I'm not sure if
it introduces IO blockers.


Reply to this email directly or view it on
GitHubhttps://github.com/cliftonc/calipso/issues/185#issuecomment-23232479
.

Contributor

arosboro commented Aug 26, 2013

Thanks,

I just added logic to create new fields and sections in addition to updating existing fields.

Enjoy your vacation.

Collaborator

richtera commented Aug 31, 2013

It seems nodejitsu is currently broken and the site is down again.

@richtera richtera added a commit that referenced this issue Sep 6, 2013

@richtera richtera Calipso improvments
Upgrade to mongoose 3.6.x (sort api changed, needs testing) this allows us to use mongodb 1.3.x which
	has better SmartOS support.
Bump version
Fix Issue #213
Merge arosboro's changes for Issue #185
c60720a
Collaborator

richtera commented Sep 6, 2013

This is now merged.

richtera closed this Sep 6, 2013

@btat btat pushed a commit to Stackato-Apps/calipso that referenced this issue May 28, 2015

@richtera richtera + Billy Tat Calipso improvments
Upgrade to mongoose 3.6.x (sort api changed, needs testing) this allows us to use mongodb 1.3.x which
	has better SmartOS support.
Bump version
Fix Issue #213
Merge arosboro's changes for Issue #185
9210e77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment