Improve portal content documentation

This commit is contained in:
2026-09-06 13:43:10 +10:00
parent 6920163026
commit 28c095c2d1
7 changed files with 43 additions and 14 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ WiFiManager wifi;
void setup() {
Serial.begin(115200);
wifi.setConfigPortalTimeout(180);
wifi.setConfigPortalTimeout(180); // Stop the portal after three minutes.
wifi.autoConnect("Example Setup", "change-me");
}
@@ -20,7 +20,7 @@ void loop() {
}
```
`autoConnect()` first tries stored station credentials. If that cannot connect, it starts the AP and portal with the supplied name and password, then returns `false`; call `process()` from `loop()` so that portal can run. Use a Wi-Fi-valid AP password.
`autoConnect()` first tries stored station credentials. If that cannot connect, it starts the AP and portal with the supplied name and password, then returns `false`; call `process()` from `loop()` so that portal can run. `setConfigPortalTimeout(180)` limits that portal to three minutes; pass `0` (the default) to leave it open. Use a Wi-Fi-valid AP password.
## PlatformIO dependency
+8
View File
@@ -68,6 +68,14 @@ Leave a text or colour value empty, or a radius at `0`, to retain the built-in s
Theme values accept only simple semantic CSS value syntax and are emitted once into a small `#wm-portal-theme` block. This is deliberately not a raw CSS or JavaScript injection API. An SVG is a trusted compiled firmware asset, never form, MQTT, or network input.
## Structured portal content
`portalAddParameter()` adds an editable application value. `portalAddInfoSection()` renders labelled read-only values, and `portalAddHomeCard()` adds a text, callout, or key/value card to the overview.
Register content before opening the portal. A `WiFiManagerParameter` remains application-owned and must outlive the portal; info sections and home cards are copied when registered. Handle a saved value in `setSaveParamsCallback()`, then validate and persist it in your application.
The buildable [Custom Portal Content](../examples/CustomPortalContent/) example uses all three without replacing the built-in portal shell.
## Built-in portal capabilities
Presentation uses one configuration route: `setPortalConfig()`. Existing structured portal capabilities remain separate: `portalAddParameter()`, `portalAddInfoSection()`, `portalAddHomeCard()`, page visibility, and portal behavior configure documented built-in functionality rather than private markup. See [Portal API](PORTAL_API.md) and [Station profiles](STATION_PROFILES.md).
+3 -1
View File
@@ -3,9 +3,11 @@
| I want to… | Read |
| --- | --- |
| Start a basic portal or install a released dependency | [Getting started](GETTING_STARTED.md) |
| Brand the portal or add structured built-in content | [Portal UI](PORTAL_UI.md) |
| Brand the built-in portal | [Portal UI](PORTAL_UI.md) |
| Add application settings, status, or home cards | [Structured portal content](PORTAL_UI.md#structured-portal-content) |
| Configure primary/fallback station profiles or their portal workflow | [Station profiles](STATION_PROFILES.md) |
| Consume JSON endpoints or station-connect status | [Portal API](PORTAL_API.md) |
| Run documentation and board-free compile checks | [Testing](TESTING.md) |
| Build or flash a complete example | [Examples](../examples/README.md) |
| Work on this fork or make a release | [Development and releases](DEVELOPMENT.md) |