So as I developed in Bubble, I made a huge amount of use of their “Reusable Elements”, which are sections of a design you can define once then re-use (instantiate) in different parts of your project.
So in some ways they feel like a Server Side Include.
Except that you could define “states” on them which would allow each instance to be passed and to return different values. So they became the HTML equivalent of a software procedure call.
Now I want to do the same thing in my Wappler based design, and I’m wondering:
Is this possible
The best way to do it
I’d love to hear your thoughts!
Best wishes,
Antony.
PS - here are some use cases…
A use case I will come across shortly is a booking form which can allow up to 6 people to book on an event. The code for each person to book is the same, but the values to pass in and out of that code is different.
Other use cases may not be so linear in their structure, and I may just need the same GUI to be displayed in different parts of my app depending on the situation, but with different data each time.
So here is an example… I have some code to view a “populated message template”… so the template may say Hello [First Name], and the populated version says Hello Teodor. Here is how it looks in reality:
I want to be able to instantiate this “Message Template Viewer” in various places on the page where different kinds of message templates are being managed.
In Bubble I could just define the code for this in a “Reusable Element” and instantiate it where ever I wanted to.
How do I do that in Wappler?
I was imagining storing the code for this to be in a file called ssi_message_template_viewer.php and then including it at various places on the page, but maybe there is a better way!
No, only one will be displayed at once. Hence the database references will work okay, I’m guessing it is just the ids that are a problem? Since there is no form or anything iike that, I guess i could just strip them all out…