Skip to content

Commit 3aeb814

Browse files
akoclaude
andcommitted
docs: add IMAGE datasource properties and PLUGGABLEWIDGET escape hatch
Enhance IMAGE widget documentation in create-page.md skill: - Add datasource modes table (image, imageUrl, icon) - Add PLUGGABLEWIDGET syntax examples for setting image source - Add ALTER PAGE example for replacing existing IMAGE widgets - Add general PLUGGABLEWIDGET escape hatch section explaining that all shorthand widgets support full property access via PLUGGABLEWIDGET Prevents AI agents from incorrectly telling users that image sources require manual Studio Pro configuration. Closes #149 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0e10f11 commit 3aeb814

1 file changed

Lines changed: 52 additions & 3 deletions

File tree

.claude/skills/mendix/create-page.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,18 +566,50 @@ SNIPPETCALL actions (Snippet: Module.EntityActions, Params: {Entity: $currentObj
566566
Display images on pages:
567567

568568
```sql
569-
-- Static image (from image gallery) - IMAGE and STATICIMAGE are equivalent
569+
-- Image with dimensions (responsive by default)
570570
IMAGE imgLogo (Width: 200, Height: 100)
571571
STATICIMAGE imgBanner (Width: 400, Height: 120)
572572

573573
-- Dynamic image (from entity data source, e.g. inside a DataView)
574574
DYNAMICIMAGE imgProduct (Width: 300, Height: 200)
575575

576-
-- Image without explicit dimensions (responsive by default)
576+
-- Image without explicit dimensions
577577
IMAGE imgIcon
578578
```
579579

580-
**Properties:** `Width: integer`, `Height: integer`, `Class: 'css'`, `Style: 'css'`
580+
**Properties:** `Width: integer`, `Height: integer`, `AlternativeText: 'text'`, `WidthUnit: pixels | percentage | auto`, `HeightUnit: pixels | percentage | auto`, `Responsive: true | false`, `DisplayAs: fullImage | thumbnail | icon`, `Class: 'css'`, `Style: 'css'`
581+
582+
#### Setting Image Source (PLUGGABLEWIDGET syntax)
583+
584+
The IMAGE shorthand creates a pluggable Image widget. For advanced properties like image source, use PLUGGABLEWIDGET syntax:
585+
586+
| Mode | Property | Use Case |
587+
|------|----------|----------|
588+
| `datasource: image` | `imageObject` | Dynamic image from entity (default) |
589+
| `datasource: imageUrl` | `imageUrl: 'path'` | Static image from URL or file path |
590+
| `datasource: icon` | `imageIcon` | Icon-based image |
591+
592+
```sql
593+
-- Static image from file (logos, branding)
594+
PLUGGABLEWIDGET 'com.mendix.widget.web.image.Image' imgLogo (
595+
datasource: imageUrl,
596+
imageUrl: 'img/logo.svg',
597+
widthUnit: pixels, width: 48,
598+
heightUnit: pixels, height: 48
599+
)
600+
601+
-- Update existing IMAGE via ALTER PAGE
602+
ALTER PAGE Mod.Home {
603+
REPLACE imgLogo WITH {
604+
PLUGGABLEWIDGET 'com.mendix.widget.web.image.Image' imgLogo (
605+
datasource: imageUrl, imageUrl: 'img/logo_dark.svg',
606+
widthUnit: pixels, width: 48, heightUnit: pixels, height: 48
607+
)
608+
}
609+
};
610+
```
611+
612+
For theme images, use paths relative to `theme/web/` (e.g., `img/logo.svg``theme/web/img/logo.svg`).
581613

582614
### CONTAINER / CUSTOMCONTAINER Widgets
583615

@@ -836,6 +868,23 @@ UPDATE WIDGETS SET 'showLabel' = false WHERE WidgetType LIKE '%combobox%';
836868
UPDATE WIDGETS SET 'Class' = 'btn-lg', 'Style' = 'margin-top: 8px;' WHERE WidgetType LIKE '%ActionButton%';
837869
```
838870
871+
## PLUGGABLEWIDGET Escape Hatch
872+
873+
All shorthand widgets (IMAGE, COMBOBOX, GALLERY, DATAGRID, etc.) are pluggable widgets under the hood. When the shorthand doesn't expose a property you need, use `PLUGGABLEWIDGET 'widget.id' name (properties)` for full access to all widget properties.
874+
875+
```sql
876+
-- Shorthand (common properties only)
877+
IMAGE imgLogo (Width: 48, Height: 48)
878+
879+
-- Full PLUGGABLEWIDGET syntax (all properties available)
880+
PLUGGABLEWIDGET 'com.mendix.widget.web.image.Image' imgLogo (
881+
datasource: imageUrl, imageUrl: 'img/logo.svg',
882+
widthUnit: pixels, width: 48, heightUnit: pixels, height: 48
883+
)
884+
```
885+
886+
Run `mxcli widget docs -p app.mpr` to generate complete property documentation for all pluggable widgets in the project. Output is saved to `.ai-context/skills/widgets/`.
887+
839888
## See Also
840889

841890
- [Overview Pages](./overview-pages.md) - CRUD page patterns

0 commit comments

Comments
 (0)