mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #373] How can i add another button to template.html #313
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#313
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 @erdemontas on GitHub (Jun 2, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/373
I'm trying to add another form to your template but I'm a newbie in html So I felt like to ask.
Here is the question; How can i add another button and get two values using two form.Main purpose is getting min-max values from user and activate a buzzer for a weather station project.
First of all; which file should I edit to manipulate template. template.h or WiFiManager.template.html
Secondly I added 3rd line and I wanna get two integer as temp values. But esp12 still works with old template.
<form action=\"/wifi\" method=\"get\"><button>Configure WiFi</button></form><br/> <form action=\"/0wifi\" method=\"get\"><button>Configure WiFi (No Scan)</button></form><br/> <form action=\"/setTemp\" method=\"get\"><button>Set Temp Values</button></form><br/><!-- New Button--> <form action=\"/i\" method=\"get\"><button>Info</button></form><br/> <form action=\"/r\" method=\"post\"><button>Reset</button></form>@tzapu commented on GitHub (Jun 2, 2017):
hi
look into documentation for adding custom parameters
good luck
@erdemontas commented on GitHub (Jun 3, 2017):
It addes to Configure Wifi page when I add custom parameter, is there any way to add somewhere else?
@brendanvanbreda commented on GitHub (Jun 8, 2017):
@erdemontas where exactly do you want it added?
@erdemontas commented on GitHub (Jun 8, 2017):
@brendanvanbreda to main screen. When you first enter to 192.168.4.1 you see 4 button
Configure Wifi
Configure Wifi(no scan)
Info
Reset
I want to have another button in this page. I also tried to change template.h and wifimanager.cpp in the library folder but It still shows the same screen.
PS: I successfully added two parameter with using custom parameter functions but thats not exactly what I want and this is the code I'm using
@brendanvanbreda commented on GitHub (Jun 8, 2017):
@erdemontas have a look at the functions
WiFiManager::handleWifiSave()andWiFiManager::handleWifiSave(). If you understand how the ESP8266 generates and serves the web pages. You need to create something similar and include these inside theWiFiManager::setupConfigPortal()in the setup web pages sections in this function inside the WifiManager.cpp. You can move the parameter generation part from theWiFiManager::handleWifi()to your new function and you should be able to view this as a new button once you edit the WifiManager.hHTTP_PORTAL_OPTIONS[]to add a new button. I have this working on my own implementation.Quite a bit of extra code needs to be added in order to be able to do this but it can be done.
Good Luck
@oscarmoutinho commented on GitHub (Jul 26, 2017):
I wanted to use only the wifi config page without modifying the core, so I added:
wifiManager.setCustomHeadElement("");
So the wifi config page is shown (/wifi[?...]) and save page (/wifisave) is not blocked.
You may explore this approach.
@tablatronix commented on GitHub (Aug 27, 2017):
Hooks will be added if they do not already exist