Inlay issueshttps://lab.civicrm.org/extensions/inlay/-/issues2023-12-18T12:10:19Zhttps://lab.civicrm.org/extensions/inlay/-/issues/14Possible feature: Support oEmbed?2023-12-18T12:10:19ZRichPossible feature: Support oEmbed?Inlay could support oEmbed easier than [core could](https://lab.civicrm.org/dev/core/-/issues/2994) because Inlays are generally written to be stateless (not rely on sessions) whereas anything with multipage quickforms does use sessions....Inlay could support oEmbed easier than [core could](https://lab.civicrm.org/dev/core/-/issues/2994) because Inlays are generally written to be stateless (not rely on sessions) whereas anything with multipage quickforms does use sessions.
Implementation sketch
1. Configuration allows for a house CSS to be provided.
2. A new public endpoint, e.g. at `/civicrm/inlay/public/{inlayPublicIDHash}` provides an HTML document that is blank except for pulling in the CSS (1), the `<script>` tag for the inlay, and a `<link>` tag that provides an oembed URL...
3. A new public endpoint, e.g. at `/civicrm/inlay/oembed/?url={urlFrom2}&format=json` provides a json response:
```
{ title: {someConfiguredPublicTitle}, height: 600, width: 600,
html: "<iframe src={urlFrom1} ...></iframe>" }
```
## Pros
Then any system that supports iframed oembed and was given the url (2) would automatically suck in the inlay's content.
## Cons
This would be a poor version of what inlay already does.
- Inlay normally uses the parent page's styles. As these will be out of reach now, we'll require (1) to implement a house style; the inlay used via oEmbed will use this style wherever it is placed.
- Iframe sizing is a UX nightmare.
- Inlay normally restricts where it can be used (or, more specifically, it restricts the domains that are allowed to submit _requests_ to its API endpoint; which in typical cases means that an unconfigured domain will show the inlay, but not allow it to process submissions). Once we do this, any site could embed the functionality, and also we have to provide a public URL for it which could confuse people if that URL itself were to be shared (e.g. someone puts it on a site that does not support oEmbed).
## Interest?
So it could be done relatively easily, and thereby it could make inlay-able-content available instantly on any system that supports oEmbed (quite a few). It's not really what it was designed for, and not all inlay types would make sense in an iframe-ed box, but it could have its uses. It could be useful in terms of spreading adoption of inlay. I don't have much interest in that goal myself - inlay was a tool I wrote to help us develop custom things for clients, predominantly, and I don't make money from others who use it - but others might.
If you're interested and have funding, then get in touch with me, here or \@artfulrobot on mattermost or contact me on my website: https://artfulrobot.ukhttps://lab.civicrm.org/extensions/inlay/-/issues/12Not working on D9 sites due to services.yml configuration2023-09-13T13:48:45ZUpperholmeNot working on D9 sites due to services.yml configurationI set this up along with Form Processor and Form Processor Inlay, on a Wordpress/Civi install and it is working well. So much so that I have set it up in a very similar way to test it out on a D9/Civi site, where I cannot get it to work....I set this up along with Form Processor and Form Processor Inlay, on a Wordpress/Civi install and it is working well. So much so that I have set it up in a very similar way to test it out on a D9/Civi site, where I cannot get it to work. Comparing the two, in a search to try to find out why it's not working, I can see that (apart from using a different CMS), the D9 site is running on PHP 8.1 where the working site is on 7.4. Also the version of CiviCRM is a little different on both, with the D9 site running 5.64.1 and the WP site running 5.62.1.
The errors that I can see in the browser console on the page where the remote form is hosted show up when I click the Submit button, and look like:
```
[Error] Origin https://where.theformishosted.uk is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://mycivi.install.uk/civicrm/inlay-api due to access control checks.
[Error] Failed to load resource: Origin https://where.theformishosted.uk is not allowed by Access-Control-Allow-Origin. Status code: 200 (inlay-api, line 0)
```
Before I start in on changing the version of PHP I'm running on I thought I'd post this to see if I'm on the right track (or not).