[GH-ISSUE #925] Change template strings from device code #783

Open
opened 2026-02-28 01:27:01 +03:00 by kerem · 9 comments
Owner

Originally created by @array81 on GitHub (Aug 14, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/925

I think I understood how edit template file and the generate HTTP_HEAD, HTTP_STYLE, ... strings.
Is there a way to pass these strings on my device code without edit WifiManager.h file?

I'd like don't change your code but I need change HTTP_HEAD_END to add imgae logo by base64 and HTTP_STYLE to change color button.

Originally created by @array81 on GitHub (Aug 14, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/925 I think I understood how edit template file and the generate HTTP_HEAD, HTTP_STYLE, ... strings. Is there a way to pass these strings on my device code without edit WifiManager.h file? I'd like don't change your code but I need change HTTP_HEAD_END to add imgae logo by base64 and HTTP_STYLE to change color button.
Author
Owner

@tablatronix commented on GitHub (Aug 14, 2019):

I never figured out a way to predefine in sketch or include before library, I have seen it done, I just have no idea how to do it.

<!-- gh-comment-id:521325342 --> @tablatronix commented on GitHub (Aug 14, 2019): I never figured out a way to predefine in sketch or include before library, I have seen it done, I just have no idea how to do it.
Author
Owner

@array81 commented on GitHub (Aug 20, 2019):

I think a similar feature should be added.
You should not have to change the library for this kind of thing and it is inconvenient if one has multiple projects with different templates.

<!-- gh-comment-id:523109686 --> @array81 commented on GitHub (Aug 20, 2019): I think a similar feature should be added. You should not have to change the library for this kind of thing and it is inconvenient if one has multiple projects with different templates.
Author
Owner

@tablatronix commented on GitHub (Aug 20, 2019):

you can override in build flags
#ifndef WIFI_MANAGER_OVERRIDE_STRINGS

and set your own file however you want

<!-- gh-comment-id:523118240 --> @tablatronix commented on GitHub (Aug 20, 2019): you can override in build flags `#ifndef WIFI_MANAGER_OVERRIDE_STRINGS` and set your own file however you want
Author
Owner

@tablatronix commented on GitHub (Aug 20, 2019):

There is an issue to create a few hooks for basic stuff. Ill check where we left off on the header hook

<!-- gh-comment-id:523118778 --> @tablatronix commented on GitHub (Aug 20, 2019): There is an issue to create a few hooks for basic stuff. Ill check where we left off on the header hook
Author
Owner

@tablatronix commented on GitHub (Aug 20, 2019):

you know you can inject in head right ?

    //if this is set, customise style
    void          setCustomHeadElement(const char* element);

a callback might be better, but for now this might help you

<!-- gh-comment-id:523120497 --> @tablatronix commented on GitHub (Aug 20, 2019): you know you can inject in head right ? ```C++ //if this is set, customise style void setCustomHeadElement(const char* element); ``` a callback might be better, but for now this might help you
Author
Owner

@array81 commented on GitHub (Aug 20, 2019):

On version 0.14 I not found WIFI_MANAGER_OVERRIDE_STRINGS reference, what is it?

<!-- gh-comment-id:523200528 --> @array81 commented on GitHub (Aug 20, 2019): On version 0.14 I not found WIFI_MANAGER_OVERRIDE_STRINGS reference, what is it?
Author
Owner

@tablatronix commented on GitHub (Aug 20, 2019):

Development branch

<!-- gh-comment-id:523232953 --> @tablatronix commented on GitHub (Aug 20, 2019): Development branch
Author
Owner

@array81 commented on GitHub (Aug 21, 2019):

In development version I can see this warning on "strings_en.h":
!!! THIS DOES NOT WORK, you cannot define in a sketch, if anyone one knows how to order includes to be able to do this help!

Are you sure that WIFI_MANAGER_OVERRIDE_STRINGS works?

<!-- gh-comment-id:523467044 --> @array81 commented on GitHub (Aug 21, 2019): In development version I can see this warning on "strings_en.h": `!!! THIS DOES NOT WORK, you cannot define in a sketch, if anyone one knows how to order includes to be able to do this help!` Are you sure that WIFI_MANAGER_OVERRIDE_STRINGS works?
Author
Owner

@tablatronix commented on GitHub (Aug 21, 2019):

It has not been tested, and you cannot define in sketch but you can define in build flags, no idea if arduino lets you do that or not, but platformio does.

<!-- gh-comment-id:523497964 --> @tablatronix commented on GitHub (Aug 21, 2019): It has not been tested, and you cannot define in sketch but you can define in build flags, no idea if arduino lets you do that or not, but platformio does.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#783
No description provided.