tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.45k stars 1.94k forks source link

Custom HTML at the Top of "<body>" #1695

Open ab-tools opened 6 months ago

ab-tools commented 6 months ago

Added setCustomTopBodyElement allowing to define custom HTML to be added at the top of the "" tag.

This is very useful to add a custom HTML header, e. g. also a logo at the top of the page.

I know this would in general be possible with WIFI_MANAGER_OVERRIDE_STRINGS and copying the whole wm_strings_en.h file, however, if the only goal is to add a single line of HTML code at the top of the page this seems like a bad idea: Whenever something would get added in that file, these changes would need to be copied over manually to the custom file again.

Having the option to just "inject" and additional HTML code at the top of the body tag (similar as it is already possible to inject something at the bottom of the "head" tag) seems a much better option.