apostrophe-schemas
Advanced tools
Comparing version 0.5.9 to 0.5.10
@@ -391,2 +391,9 @@ var async = require('async'); | ||
} | ||
// Fields that are contextual are edited in the context of a | ||
// show page and do not appear in regular schema forms. They are | ||
// however legitimate in imports, so we make sure it's a form | ||
// and not a CSV that we're skipping it for. | ||
if (field.contextual && (from === 'form')) { | ||
return; | ||
} | ||
self.converters[from][field.type](data, field.name, object, field); | ||
@@ -393,0 +400,0 @@ }); |
{ | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"name": "apostrophe-schemas", | ||
@@ -33,2 +33,2 @@ "description": "Schemas for easy editing of properties in Apostrophe objects", | ||
} | ||
} | ||
} |
@@ -45,2 +45,5 @@ function AposSchemas() { | ||
_.each(schema, function(field) { | ||
if (field.contextual) { | ||
return; | ||
} | ||
// This won't be enough for every type of field, so we pass $el too | ||
@@ -47,0 +50,0 @@ var $field = $el.findByName(field.name); |
@@ -17,2 +17,3 @@ # apostrophe-schemas | ||
* [Saving Objects On the Server](#editing-saving-objects-on-the-server) | ||
* [Editing Fields In Context](#editing-fields-in-context) | ||
* [Joins in Schemas](#joins-in-schemas) | ||
@@ -261,2 +262,12 @@ * [one-to-one](#one-to-one-joins) | ||
### Editing Fields In Context | ||
For snippets, the entire object is usually edited in a modal dialog. But if you are using schemas to enhance regular pages via the [apostrophe-fancy-pages](https://github.com/punkave/apostrophe-fancy-pages) module, you might prefer to edit certain areas and singletons "in context" on the page itself. | ||
You could just leave them out of the schema, and take advantage of Apostrophe's support for "spontaneous areas" created by `aposArea` and `aposSingleton` calls in templates. | ||
An alternative is to set `contextual` to `false` for such fields. This will keep them out of forms generated by `{{ schemaFields }}`, but will not prevent you from taking advantage of other features of schemas, such as CSV import. | ||
Either way, it is your responsibility to add an appropriate `aposArea` or `aposSingleton` call to the page, as you are most likely doing already. | ||
### Joins in Schemas | ||
@@ -263,0 +274,0 @@ |
Sorry, the diff of this file is not supported yet
78345
959
861