Score:0

How can I display the output of a view with no surrounding templates that can be embedded in an iframe inside another website?

cn flag

I have a user contextual view which is accessed via a URL like:

/user/114/my-view

I want to provide the output of this view in a raw format without any surrounding page HTML so that it can be emdedded in an iframe in any website.

I bascially need to get rid of anything that is produced by the page template.

A similar question can be found here, but it is very old and refers to Drupal 7: https://stackoverflow.com/questions/247991/displaying-a-drupal-view-without-a-page-template-around-it

I am happy with the concept of modifing the view template itself, but I am unsure if the correct approach is to create a version of page.html.twig with no markup other than the $content variable?

Another consideration I'm unsure of is the CORS settings. I believe embedding the page in another website will not work unless some settings are changed to allow this?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.