Skip to content

Commit dd8606e

Browse files
committed
Document :iframedialog target format
1 parent a3ed416 commit dd8606e

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

Diff for: src/configuration/ViewerConfiguration.md

+32-23
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,20 @@ Any plugin configuration option can be overridden per theme in the theme item `c
161161
}
162162
}
163163
```
164-
A particularly interesting aspect is the configuration of the entries in the application menu and toolbar, i.e. the entries in `menuItems` and `toolbarItems` in the `TopBar` plugin configuration. The format of these entries is as follows:
164+
165+
In general, the procedure for enabling a plugin is:
166+
167+
* Make sure the plugin is compiled into the application (see [Build-time configuration](#build-time configuration)).
168+
* In the `plugins` section of `config.json`, below `common` (or `mobile` and/or `desktop`), add an entry
169+
```json
170+
{
171+
"name": "<Plugin name>",
172+
"cfg": {
173+
<Plugin configuration props>
174+
}
175+
}
176+
```
177+
* For most plugins (i.e. those which launch as an explicit task in the viewer), add entries in `menuItems` and/or `toolbarItems` in the `TopBar` configuration. The format of these entires is as follows:
165178

166179
| Setting | Description |
167180
|--------------------------------------------|-----------------------------------------------------------------------------------|
@@ -177,13 +190,12 @@ A particularly interesting aspect is the configuration of the entries in the app
177190
|`⁣  "shortcut": "<shortcut>"` | Optional, keyboard shortcut which triggers the entry, i.e. `"alt+shift+a"`. |
178191
|`}` | |
179192

180-
*Note:* The built-in icons are those located in [`qwc2-app/qwc2/icons`](https://github.com/qgis/qwc2/tree/master/icons) and in `qwc2-app/icons`. The built-in icon names are the respective file names, without `.svg` extension.
193+
*Note:* The built-in icons are those located in [`qwc2/icons`](https://github.com/qgis/qwc2/tree/master/icons) and in `qwc-app/icons`. The built-in icon names are the respective file names, without `.svg` extension.
181194

182-
Also the map buttons ([LocationButton](../references/qwc2_plugins.md#locatebutton), [HomeButton](../references/qwc2_plugins.md#homebutton), [TaskButton](../references/qwc2_plugins.md#taskbutton), [ZoomButton](../references/qwc2_plugins.md#zoombutton)) support `themeFlagBlacklist` and `themeFlagWhitelist` for controlling the visibility based on the [theme flags](ThemesConfiguration.md#manual-theme-configuration).
183195

184196
**Opening external websites**<a name="opening-external-websites"></a>
185197

186-
As a special case, entries for opening external URLs can be defined as follows:
198+
As a special case, entries for opening external URLs can be defined in the `menuItems` and/or `toolbarItems` in the `TopBar` configuration as follows:
187199

188200
| Setting | Description |
189201
|------------------------|-----------------------------------------------------------------------------------|
@@ -192,28 +204,25 @@ As a special case, entries for opening external URLs can be defined as follows:
192204
|`⁣  "title": "<key>",` | Optional: Title to use insead of `appmenu.items.<key>`. |
193205
|`⁣  "icon": "<icon>",` | As above. |
194206
|`⁣  "url": "<url>",` | The URL to open. Can contain as placeholders the keys listed in [URL Parameters](../topics/Interfacing.md#url-parameters), encolsed in `$` (i.e. `$e$` for the extent). In addition, the placeholders `$x$` and `$y$` for the individual map center coordinates are also supported. |
195-
|`⁣  "target": "<target>"`| The target where to open the URL, if empty, `_blank` is assumed. Can be `iframe` to open the link in a iframe window inside QWC2. |
207+
|`⁣  "target": "<target>"`| The target where to open the URL, if empty, `_blank` is assumed. Can be `iframe` or `:iframedialog:<windowname>:<options>` (see below) to open the link in a iframe window inside QWC. |
196208
|`}` | |
197209

198-
In general, the procedure for enabling a plugin is:
210+
The format of the `:iframedialog:<windowname>:<options>` target is as follows:
211+
212+
- `windowname` is used to identify the name of the iframe window within which the link will be opened, i.e. can be used to make multiple external URLs re-use the same iframe window.
213+
- `options` is a sequence of `<key>=<value>`, separated by `:`, with the following options:
214+
215+
- `dockable=<false|left|right|top|bottom>`: whether the window is dockable, and to which screen edge
216+
- `docked=<true|false>`: whether the window is docked by default
217+
- `splitScreenWhenDocked=<true|false>`: whether to split the screen when docked
218+
- `h=<h>`: the initial window height
219+
- `w=<w>`: the initial window width
220+
- `zIndex=<zIndex>`: the stacking zIndex for the dialog
221+
- `icon=<icon>`: the name of a build-in icon (see [`qwc2/icons`](https://github.com/qgis/qwc2/tree/master/icons)) to display in the window title bar (overrides the icon set in the `menuItems`/`tollbarItems` entry)
222+
- `title=<title>`: the title to display in the window title bar (overrides the title set in the `menuItems`/`tollbarItems` entry)
223+
- `print=<true|false>`: whether to display a print icon in the window title bar
224+
199225

200-
* Make sure the plugin is compiled into the application (see [Build-time configuration](#build-time configuration)).
201-
* In the `plugins` section of `config.json`, below `common` (or `mobile` and/or `desktop`), add an entry
202-
```json
203-
{
204-
"name": "<Plugin name>",
205-
"cfg": {
206-
<Plugin configuration props>
207-
}
208-
}
209-
```
210-
* For most plugins (i.e. those which launch as an explicit task in the viewer), add entries in `menuItems` and/or `toolbarItems` as desired, i.e.
211-
```json
212-
"menuItems": [
213-
...
214-
{"key": "<Plugin name>", "icon": "<icon name>", ...}
215-
]
216-
```
217226
## Customizing the viewer assets <a name="viewer-assets"></a>
218227

219228
The viewer assets are located as follows:

0 commit comments

Comments
 (0)