mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1378] QUESTION: Can we add custom wepage to the menu? #1182
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Renison-Gohel on GitHub (Mar 27, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1378
How could we add custom html webpage to the main menu of configuration page and redirect to specific web address like /custompage when user click on newly add ( created ) custom button on the main page. is that possible with-in wifi manager? @tzapu @tablatronix
@tablatronix commented on GitHub (Mar 27, 2022):
Yes, not straightforward but you can do it. Let me work up an example
@zen85 commented on GitHub (Mar 29, 2022):
i am really looking forward to it since its something i only had limited success with for some time now. thanks for the great work!
@tablatronix commented on GitHub (Mar 29, 2022):
ok you could do it before, but you had to edit the strings code. You can still do it like that but I added a way to do it via code now.
you will have to enable the custom menu item via
setMenuput it where you want in the order.then set the custom menu item html ( can be many buttons or anything really )
The only issue is that you are limited to the one menu item, which CAN be contiguous buttons, so not a big deal as you can hack in html anyway to workaround it )
I will work up an actual example
you can see it in action in the SUPER/ example already
Now if you want to do whatever on your external routes you can do anything you want there, or change the
const char R_root[] PROGMEM = "/";
to a custom page and make your own entire menu etc
@zen85 commented on GitHub (Mar 30, 2022):
this is what i did and it works:
and in strings_en.h
what i did not manage to do:
I, for example, want to show analogue readings from pins on the /values page and i did not find a way to do that.
I found this way via dummyframe to toggle a pin via /custom though...
Can you think of an example where i can show dynamically readings from a sensor on a custom page?
@tablatronix commented on GitHub (Mar 30, 2022):
Ahh i see, yeah you can also check serverargs for querystrings etc. You can probably get rid of the frame and use a button that does not have a target if you want to stay on the menu page on click. but thats just all html tricks
Yeah exactly , cept now you can just add the buttons via the customMenuHTML instead of strings.
for values, just add stuff to the html in
@zen85 commented on GitHub (Apr 2, 2022):
that actually worked:
the weird thing is, that it seems to reload the side about every 5 seconds on its own..
@tablatronix commented on GitHub (Apr 2, 2022):
Thats odd
@zen85 commented on GitHub (Apr 3, 2022):
and completly my bad.... had <META http-equiv=refresh content=”5"> in my html by accident...
@tablatronix commented on GitHub (Apr 7, 2022):
6a85acdf85