Skip to content

Commit

Permalink
Added research doc for named types
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Dunogier committed Feb 18, 2020
1 parent ad9095c commit e30726e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions doc/research/named_field_types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Named query field types

A higher level version of the query field type. Through configuration, queries are associated to a name. Those are added added to the list of available field types. When added, they query type isn't show, and the parameters are immediately displayed for editing. It saves time when modelling the content by allowing to reuse the same type for a similar concept.

## Examples

```
ezplatform:
named_query_types:
children:
query_type: eZ:Children
default_parameters:
location: '@=location'
type: '@=returnedType'
relating_content:
query_type: eZ:ContentRelatedTo
default_parameters:
to_content: '@=content'
type: '@=returnedType'
```

## Extra features

### Default query type parameters

Content and location level (not field) based parameters can get a default value: the current content, its section, the returned type...

### Translation

That extra layer is a good place for translating parameters.

### Customization

Custom templates could be associated to named query field types, giving extra flexibility.

### Extensibiliy

Named queries make it easy for 3rd parties to add their own field types without developing any:

- define new query types, with custom criteria if needed
- define named queries

0 comments on commit e30726e

Please sign in to comment.