Skip to content

Page_Element blocking other HTML content #42

Answered by Hieromon
DooCue asked this question in Q&A
Discussion options

You must be logged in to vote

How to share the same page element with different PageBuilder content:

#include <Arduino.h>
#include <WiFi.h>
#include <WebServer.h>
#include <FS.h>
#include <SPIFFS.h>
#include <PageBuilder.h>

#define SSID      "********"
#define PASSWORD  "********"

WebServer server;

const char* const URI_Page1 = "/Page1";
const char* const URI_Page2 = "/Page2";
const char* const URI_Page3 = "/Page3";

const char* const _PAGE_HEADER = R"(
<html>
  <body>
    <h1>{{TITLE}}</h1>  
)";

const char* const _PAGE_CONTENT = R"(
    <h4>{{CONTENT}}</h4>
)";

const char* const _PAGE_TRAILER = R"(
  </body>
</html>
)";

// Page header elements
PageElement PAGE_HEADER1(_PAGE_HEADER, {
  {"TITLE", [](PageArgumen…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Hieromon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants