forked from MapComplete/MapComplete
		
	Improve documentation
This commit is contained in:
		
							parent
							
								
									336b7b39aa
								
							
						
					
					
						commit
						d9979940ee
					
				
					 2 changed files with 38 additions and 3 deletions
				
			
		|  | @ -35,9 +35,43 @@ export interface TagRenderingConfigJson { | |||
|     render?: string | any, | ||||
|      | ||||
|     /** | ||||
|      * Only show this tagrendering (or question) if the object also matches the following tags. | ||||
|      * Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`. | ||||
|      * | ||||
|      * This is useful to ask a follow-up question. E.g. if there is a diaper table, then ask a follow-up question on diaper tables... | ||||
|      * This is useful to ask a follow-up question. | ||||
|      * For example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one. | ||||
|      * This can be done by adding `"condition": "changing_table=yes"` | ||||
|      *  | ||||
|      * A full example would be: | ||||
|      * ```json
 | ||||
|      *     { | ||||
|      *       "question": "Where is the changing table located?", | ||||
|      *       "render": "The changing table is located at {changing_table:location}", | ||||
|      *       "condition": "changing_table=yes", | ||||
|      *       "freeform": { | ||||
|      *         "key": "changing_table:location", | ||||
|      *         "inline": true | ||||
|      *       }, | ||||
|      *       "mappings": [ | ||||
|      *         { | ||||
|      *           "then": "The changing table is in the toilet for women.", | ||||
|      *           "if": "changing_table:location=female_toilet" | ||||
|      *         }, | ||||
|      *         { | ||||
|      *           "then": "The changing table is in the toilet for men.", | ||||
|      *           "if": "changing_table:location=male_toilet" | ||||
|      *         }, | ||||
|      *         { | ||||
|      *           "if": "changing_table:location=wheelchair_toilet", | ||||
|      *           "then": "The changing table is in the toilet for wheelchair users.", | ||||
|      *         }, | ||||
|      *         { | ||||
|      *           "if": "changing_table:location=dedicated_room", | ||||
|      *           "then": "The changing table is in a dedicated room. ", | ||||
|      *         } | ||||
|      *       ], | ||||
|      *       "id": "toilet-changing_table:location" | ||||
|      *     }, | ||||
|      * ``` | ||||
|      * */ | ||||
|     condition?: TagConfigJson; | ||||
| 
 | ||||
|  |  | |||
|  | @ -386,7 +386,8 @@ | |||
|       }, | ||||
|       "condition": "changing_table=yes", | ||||
|       "freeform": { | ||||
|         "key": "changing_table:location" | ||||
|         "key": "changing_table:location", | ||||
|         "inline": true | ||||
|       }, | ||||
|       "mappings": [ | ||||
|         { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue