how to change the order of the titles #510
-
How to change order of this |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
What is |
Beta Was this translation helpful? Give feedback.
-
how to change order of "HOME" "EEPROM" "Reset" "Time zone" title |
Beta Was this translation helpful? Give feedback.
-
@hongthiet1994 If you are envisioning an API that allows you to easily change the order on the sketch, AutoConnect does not provide such an interface. AutoConnect/src/AutoConnectPage.cpp Lines 970 to 981 in 8f60762 In the above _token_MENU_PRE function, it is the concatenation order of the String menuItem variable that determines some menu orderliness. By changing this concatenation order, you can change the order of the Config New and Open SSIDs and Disconnect and RESET items. On the other hand, changing the menu item for a custom web page that includes AutoConnectAux --- you see it as Time/Zone, EEPROM --- requires knowledge of PageBuilder. It is a so-called simple lexical analyzer with templates and tokens. You can find its structure in the PageBuilder repository. The declaration of the template in the second half part of the menu item is located at: AutoConnect/src/AutoConnectAux.cpp Lines 29 to 72 in 8f60762 The code to replace the AutoConnect/src/AutoConnectPage.cpp Lines 983 to 990 in 8f60762 Note that the order of menu items to the custom web page depends on the order of loading. Its loading order matches the order defined in JSON or specified as a parameter list of the AutoConnect::join function. |
Beta Was this translation helpful? Give feedback.
@hongthiet1994 If you are envisioning an API that allows you to easily change the order on the sketch, AutoConnect does not provide such an interface.
However, if you are willing to modify the AutoConnect source code to achieve this, the part that generates the menu HTML is as follows:
AutoConnect/src/AutoConnectPage.cpp
Lines 970 to 981 in 8f60762