Closed MythicalForce closed 3 years ago
Thanks for your interest in the library which provides simple and general-purpose features
If you'd like to modify and add custom's HTML, I guess and expect you have good programming knowledge to know how to do it yourself.
Just add some #ifdef
to permit you to override the library's HTML and use whatever way you'd like. The code is public anyway.
You can easily do whatever you'd like to meet your use-case's requirements.
I prefer to keep the library simple and won't spend time on this rare case.
I'm closing the request now.
Just add some
#ifdef
to permit you to override the library's HTML and use whatever way you'd like.
does not work! i added #if USING_CUSTOMS_HEAD_ELEMENT
but not working... it still shows the default HTML in the lib along side mine..
You didn't use it correctly. Please read the code to understand what has been written, what you need to do, then use your imagination
For example
#ifndef USING_DEFAULT_CUSTOMS_HTML
#define USING_DEFAULT_CUSTOMS_HTML true
#endif
#if USING_DEFAULT_CUSTOMS_HTML
const char ESP_WM_LITE_HTML_HEAD_START[] = "<!DOCTYPE html><html><head><title>ESP_WM_LITE</title>";
...
#else
// These are your customs HTLMs
const char ESP_WM_LITE_HTML_HEAD_START[] = "<!DOCTYPE html><html><head><title>NEW_TITLE</title>";
...
#endif
In your sketch
#define USING_DEFAULT_CUSTOMS_HTML false
You can also use extern
instead of const char ESP_WM_LITE_HTML_HEAD_START[]
, then declare in your sketch
const char ESP_WM_LITE_HTML_HEAD_START[] = "????";
Sorry I don't like to waste my time here. You have to research and do it yourself.
that still would be a problem if you then make changes / new release and i update the lib on my end it would go back to using the HTML in the lib....
Is your feature request related to a problem? Please describe.
Well the problem im having is that i want to customize the HTML page without doing it in the lib header file itself. I noticed that there is ESP_WiFiManager->setCustomsHeadElement(); and i could add my HTML there but the problem is that then it would display my HTML along with defaults in the lib header file:
and so on! the only thing i can set that overrides is the "style" ESP_WiFiManager->setCustomsStyle(NewCustomsStyle);
it is super cute that you added // DO NOT CHANGE THIS STRING EVER!!!! i saw this and laughed and started right away editing it to customize the webpage to my liking 👍
Describe the solution you'd like
An easy way to override the current HTML set inside the lib header file!
Describe alternatives you've considered
NONE
Additional context
NONE