B4J Question Master Page in Webapp

Omar Moreno

Member
Licensed User
Longtime User
Hi.
I am creating a web application with a menu that calls the pages, it works fine, but how can I make the menu that is in index.html work as a master page that always shows even when the user enters the site without going through the index .html
 

Omar Moreno

Member
Licensed User
Longtime User
Thanks for the reply.
But how can the injection be done to the site so that it always loads the index.html
when the user enters by
localhost: 51050 / p1.html instead of localhost: 51050.
I have placed a small example, you could guide me with this example.
Thank you.
 

Attachments

  • MasterP.zip
    167.8 KB · Views: 162
Upvote 0

Omar Moreno

Member
Licensed User
Longtime User
When the user enters p1 that automatically p1 is displayed within the index page in the body (data="")

B4X:
    <!-- Body Index -->
    <main id="cpagina">
        <object type="text/html" id="paginax" data="" ></object>
    </main>

since when it does it by the index its normal content is shown.
 
Upvote 0

Omar Moreno

Member
Licensed User
Longtime User
localhost:5050
upload_2018-4-3_1-50-8.png



Entry by localhost: 5050 / p1.html
The content of index.html does not appear how to achieve it in the style of a master page.

upload_2018-4-3_1-53-25.png
 
Upvote 0

Omar Moreno

Member
Licensed User
Longtime User
Hi.
I have solved it, but I do not know if this is the best way.
I have used jquery with window.parent.document to know where the user comes from and if it is different from index.html, then redirect to index.html with the data of the input page using a variable of "Session" and thus achieve that (p1, p2, p3 ...) are inserted in the index.html page simulating a master page.
If there is a better way to do this, please indicate it.
Thank you
 
Upvote 0
Top