I want to use this composer tool to move my CSS styles inline.
I tested this by creating a new template with filename inlined.php and passing the html to a variable using
It worked if I used a static url from a remote file, but not with localhost. So that’s one issue I’d like to resolve.
I also want to use a content representation to render an inlined version of a page, and pass the html dynamically using
So I have a new template file called email.inlined.php, with this content:
<?php use Pelago\Emogrifier\CssInliner; $html = file_get_contents($page->url()); $visualHtml = CssInliner::fromHtml($html)->inlineCss()->render(); echo $visualHtml; ?>
but I get the following error in the debugger:
file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0
Is this something I can fix in the Kirby config file, or will it require me to change something in my web hosting settings somehow?