42
|
|
|
Victor Palau |
9 years ago
|
|
|
41
|
|
|
Victor Palau |
9 years ago
|
|
|
40
|
|
|
Victor Palau |
9 years ago
|
|
|
39
|
|
|
Victor Palau |
9 years ago
|
|
|
38
|
|
|
Victor Palau |
9 years ago
|
|
|
37
|
|
|
Victor Palau |
9 years ago
|
|
|
36
|
|
|
Victor Palau |
9 years ago
|
|
|
35
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
34
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
33
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
32
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
31
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
30
|
|
*Added the capabililty to specify common renderer templates in child_scopes.json, and then to declare for any child scope that if the cateogry id in the result is X, use the common template whose id is Y. A main purpose of this is to allow using a common category/layout for such things as presenting login buttons when the child scope provides a result through which the user logs in through online accounts.
One thing that makes this a little complex is that each child scope uses particular category ids for such a case. Therefore, this implementation allows any child scope (in the json) to declare the equivalent of this: if the results category id is X, use common template R.
Caution: a child scope in an aggregator should only ever have a single category, so use this feature should be used with care.
Here's how it works.
child_scopes.json now supports a new top level object called "common-templates". This includes a list of objects, each of which is a common template with two fields: id and template, like so:
{ "common_templates": [ { "id" : "not_logged_in", "template": { "schema-version": 1, "template": { "category-layout": "grid", "card-size": "large", "card-background": "color:///#5E2750" }, "components": { "title": "title", "subtitle": "subtitle" } } } ], "child_scopes": [...]
For each child scope, you can connect the incoming result to any such common template by adding a "result_category_id_to_common_template" array of objects, each of which must contain the two keys shown below
"child_scopes": [ { "scope": { "id": "com.canonical.scopes.fbphotos_fbphotos", "category_title": "FB Photos", [...] "result_category_id_to_common_template": [ { "result_category_id": "fbphotos_login", "common_template": "not_logged_in" } ] } },
* result_category_id declares the category id of the incoming result. * common_template declares the id of the template declared in this file in the "common_templates" list.
|
Kyle Nitzsche |
9 years ago
|
|
|
29
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
28
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
27
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
26
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
25
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
24
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|
23
|
|
|
Kyle Nitzsche |
9 years ago
|
|
|