Using Html::iframe Tool

I am trying to create a project type that displays an iframe. I see kirby has the Html::iframe class, but I do not understand how I am supposed to use it. I set up my project.canva.yml to have an url field, so I am hoping to put that url in an iframe when the project page loads.

Also, is there a way to get a thumbnail of the iframe to be stored/displayed on my website that is similar to how the projects page shows the cover image of each project?

Thank you for your time.

You can use it like this… the helper has two parts, the first is the url for the iframe, and the second is an optional array of html attributes that you want the iframe to have:

<?= Html::iframe('yoururl.com/page', ['width' => 300]) ?>

This would go in your page template or snippet, and you can replace the value from your feild

<?= Html::iframe($page->yoururlfield(), ['width' => 300]) ?>

I woud suggest wrapping that in an If statement, so that it checks if that field actually has a value, to avoid issues if it happens to be empty.