Turbo seems like the type of thing that will make the small apps I build much easier to build out but a very basic example seems to be impossible for me to create.
Trying lazy-loading and user initiated rendering but in all cases the HTML is fetched in the background but never rendered. I’m sure there’s something very obvious I’m doing wrong, I just can’t tell what it is!
Found something, not really shown in the reference pages of the documentation, which made the difference on my side: You need the turboframe with the same ID on the page you request.
Like in my case, I have a statically generated HTML front-end and a separate PHP back-end. I load a form I already have prepared on a PHP page, into an individual HTML page on another server.
On the PHP page I have this (this is thew piece I want to load)
<?php
Some other content on this page.....
<turbo-frame id="question-form">
<some HTML>
</some HTML>
</turbo-frame>
Both share the same ids, thus when I open the HTML page, it will render the HTML, then request the php page from the php application and render it in the turbo-frame of the HTML page.
In the reference documentation of Turbo Frame, that piece with requiring the turbo-frame with the same ID in the page that contains the snipped you want to load, seems missing (but rather important).
Thank you, I changed my IDs after experiencing a different issue and never tried putting them back. Knew it was something simple!
The thought crossed my mind but it seemed a little counter-intuitive to have the same IDs but looking at the source that is generated after the HTML is loaded it makes sense now.