Skip to content

Commit c882b04

Browse files
authored
Form widgets - Photos, Info widgets (#696)
1 parent b51162a commit c882b04

File tree

17 files changed

+97
-75
lines changed

17 files changed

+97
-75
lines changed

src/.vitepress/sidebar/en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
{ text: 'Numbers', link: '/layer/numbers/' },
7171
{ text: 'Checkbox', link: '/layer/checkbox/' },
7272
{ text: 'QR Code', link: '/layer/qr-code/' },
73-
{ text: 'Selecting Single or Multiple Values', link: '/layer/value-select/' },
73+
{ text: 'Selecting a Single or Multiple Values', link: '/layer/value-select/' },
7474
{ text: 'Photos', link: '/layer/photos/' },
7575
{ text: 'Informational Widgets', link: '/layer/info-widgets/' },
7676
] },

src/gis/features/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In [Creating a Project in QGIS](../../tutorials/creating-a-project-in-qgis/) you
1919

2020
## Survey layers
2121
Vector layers can be used as survey layers in your <MainPlatformName /> project. You can apply styles and set up the forms to make your field survey easier.
22-
The same applies for non-spatial layers that can be used on their own to add new data or linked to a spatial layer, e.g. when linking multiple [photos](../../layer/photos/#how-to-attach-multiple-photos-to-features) or [records](../../layer/one-to-n-relations/). They can be also used in [value relation](../../layer/value-select/#value-relation) widgets.
22+
The same applies for non-spatial layers that can be used on their own to add new data or linked to a spatial layer, e.g. when linking multiple [photos](../../layer/photos/#how-to-attach-multiple-photos-to-one-feature) or [records](../../layer/one-to-n-relations/). They can be also used in [value relation](../../layer/value-select/#value-relation) widgets.
2323

2424
Making changes in the data schema of layers can lead to issues in the synchronisation process. Be careful to [**deploy the revised project properly**](../../manage/deploy-new-project/). Design the data schema carefully when creating a layer to avoid the need to change it later.
2525

src/layer/form-widgets/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ Here is an overview of widgets that are commonly used both in QGIS and the <Mobi
3636
|Value Map |[Drop-down menu with predefined values](../value-select/#value-map) |![Mergin Maps mobile app value map field form](./mobile-form-valuemap-preview.jpg "Mergin Maps mobile app value map field form") |
3737
|Value Relation |[Drop-down menu with values from another table](../value-select/#value-relation) |![Mergin Maps mobile app value relation field form](./mobile-form-value-relation-preview.jpg "Mergin Maps mobile app value relation field form") |
3838
|Attachment |[Photos from device's camera or gallery](../photos) | ![Mergin Maps mobile app attachment field form](./mobile-form-photo-preview.jpg "Mergin Maps mobile app attachment field form") ![Mergin Maps mobile app attachment field form](./mobile-form-photo-preview2.jpg "Mergin Maps mobile app attachment field form") |
39-
|Relations - Gallery |[Multiple photos from device's camera or gallery](../photos/#how-to-attach-multiple-photos-to-features) | ![Mergin Maps mobile app multiple photos attributes form](./mobile-form-multiple-photo-preview.jpg "Mergin Maps mobile app multiple photos attributes form") |
39+
|Relations - Gallery |[Multiple photos from device's camera or gallery](../photos/#how-to-attach-multiple-photos-to-one-feature) | ![Mergin Maps mobile app multiple photos attributes form](./mobile-form-multiple-photo-preview.jpg "Mergin Maps mobile app multiple photos attributes form") |
4040
| Text and HTML Widgets |[Informational Widgets](../info-widgets/) | ![Mergin Maps mobile app HTML and Text widgets in attributes form](./mobile-form-info-widgets.webp "Mergin Maps mobile app HTML and Text widgets in attributes form") |

src/layer/info-widgets/index.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# Informational Widgets
22
[[toc]]
33

4-
## Display instructions in the form using Text and HTML widget
5-
Sometimes, you may want to include instructions or tips for surveyors in your forms. <QGIS link="" text="QGIS" /> offers Text and HTML widgets that can be used for this purpose. Your text instructions can include [expressions and field values](#using-expressions-in-text-and-html-widgets) as well. The HTML widget supports various [HTML tags](https://doc.qt.io/qt-6/richtext-html-subset.html#supported-tags), so it can be also used, for instance, to display [online images](#using-html-widget-to-display-online-images-and-other-online-resources).
4+
<QGISHelp ver="latest" link="/user_manual/working_with_vector/vector_properties.html#other-widgets" text="QGIS" /> also offers widgets that can be added to the form to display values or text, but are not connected to a specific field of the layer. <MainPlatformName /> supports the HTML, Text and [Spacer](../form-layout/#spacer-widget) widget.
5+
6+
HTML and Text widgets can be used, e.g., to [display instructions](#text-and-html-widget) in the form. The HTML widget supports various [HTML tags](https://doc.qt.io/qt-6/richtext-html-subset.html#supported-tags), so it can be also used, for instance, to display [online images](#using-html-widget-to-display-online-images-and-other-online-resources) or [open local files](#using-html-widget-to-open-local-files).
7+
8+
|<div style="width:150px"> Widget </div> |Preview in the <MobileAppNameShort />|
9+
|:---:|:---:|
10+
[Text and HTML Widgets](#text-and-html-widget) | ![Mergin Maps mobile app HTML and Text widgets in attributes form](../form-widgets/mobile-form-info-widgets.webp "Mergin Maps mobile app HTML and Text widgets in attributes form") |
11+
12+
13+
## Text and HTML widget
14+
The **Text** and **HTML widgets** provide an option to include instructions or tips for surveyors in your attributes forms. These text instructions can include [expressions and field values](#using-expressions-in-text-and-html-widgets) as well.
615

716
These widgets can be found in **Available Widgets** in the **Other Widgets** section when using the [Drag and Drop Designer](../form-layout/#qgis-drag-and-drop-designer).
817
![QGIS HTML and Text Widget](./qgis-form-html-text-widget.jpg "QGIS HTML and Text Widget")
@@ -16,15 +25,15 @@ If you prefer your text to be formatted, you may do so in the **HTML** widget. H
1625
...and this is how the Text and HTML widgets look like in the form in QGIS (left) and in the mobile app (right).
1726
![Text and HTML widgets in QGIS and in Mergin Maps mobile app](./qgis-form-text-html.jpg "Text and HTML widgets in QGIS and in Mergin Maps mobile app")
1827

19-
## Using expressions in Text and HTML widgets
28+
### Using expressions in Text and HTML widgets
2029
Expressions and variables can be used both in the Text and the HTML widget.
2130

22-
![QGIS Configure Text Widget Expression Builder](./qgis-text-widget-expression.gif "QGIS Configure Text Widget Expression Builder")
23-
24-
:::tip
31+
:::tip Example project available
2532
Clone <MerginMapsProject id="documentation/form_cascade" /> to follow this example.
2633
:::
2734

35+
![QGIS Configure Text Widget Expression Builder](./qgis-text-widget-expression.gif "QGIS Configure Text Widget Expression Builder")
36+
2837
1. When configuring the Text or HTML widget, click on the **Expression Builder** button
2938
2. Enter the expression that will be used in your text and click **OK**.
3039

@@ -33,6 +42,7 @@ Clone <MerginMapsProject id="documentation/form_cascade" /> to follow this examp
3342
3. Click on the **+** button to add the expression to the text.
3443

3544
Here, we configured the widget with this text:
45+
3646
`Make sure the number plate [% "VRP" %] is visible in the photo.`
3747

3848
In this case, `VRP` is the name of a field aliased as `Vehicle Registration Plate` in the form.
@@ -42,7 +52,7 @@ Clone <MerginMapsProject id="documentation/form_cascade" /> to follow this examp
4252
... and this is how it works during the field survey. `[% "VRP" %]` expression displays the current value of the `Vehicle Registration Plate` field.
4353
![Mergin Maps mobile app text widget with variable](./mobile-text-widget-expression.jpg "Mergin Maps mobile app text widget with variable")
4454

45-
## Using HTML widget to display online images and other online resources
55+
## Display online images and other online resources using HTML widget {#using-html-widget-to-display-online-images-and-other-online-resources}
4656
The **HTML widget** can be also used to display online images in the mobile app or open online resources, such as PDF files, videos or websites, in the browser of your device.
4757

4858
::: tip
@@ -73,7 +83,7 @@ QGIS may not display the preview of the online image if you use QGIS 3.36 or hig
7383
:::
7484

7585

76-
## Using HTML widget to open local files
86+
## Open local files using HTML widget {#using-html-widget-to-open-local-files}
7787
The HTML widget can also be used to open local files: for instance, a locally stored PDF file can be opened from within the form during the survey.
7888

7989
::: tip
@@ -97,16 +107,3 @@ Local files can be displayed in the form also using [default values](../open-fil
97107

98108
In the <MerginMapsProject id="documentation/forms-display-images-and-files" /> project, you can explore and compare both alternatives.
99109
:::
100-
101-
## Spacer widget
102-
<Badge text="since QGIS 3.30" type="tip"/>
103-
The Spacer widget can be useful if you want to have some space between the fields in your form or add a horizontal line.
104-
105-
It can be found in *Available Widgets* in the *Other Widgets* section when using the [Drag and Drop Designer](../form-layout/#qgis-drag-and-drop-designer).
106-
![QGIS forms Spacer Widget](./qgis-form-spacer-widget.jpg "QGIS Spacer Widget")
107-
108-
When adding the spacer widget to the form, there is an option to check the **Draw horizontal line** option. Otherwise, a vertical space will be added to the form.
109-
![QGIS Spacer Widget configuration](./qgis-configure-spacer-widget.jpg "QGIS Spacer Widget configuration")
110-
111-
And this how the spacer widget looks like in the form in QGIS (left) and in the mobile app (right).
112-
![Spacer widget in QGIS and mobile app form](./spacer-widget-forms.jpg "Spacer widget in QGIS and mobile app form")

0 commit comments

Comments
 (0)