trilbymedia / grav-plugin-image-captions

MIT License
10 stars 3 forks source link

image-caption breaks pages with 'content' defined #4

Closed hupfdule closed 2 years ago

hupfdule commented 6 years ago

If you have a page that defines some content in the frontmatter, e. g. :

---
  title: My Title
  content:
    items: '@self.descendants'
---

those pages cannot be rendered anymore.

The error message is:

DOMDocument::loadHTML(): Empty string supplied as input

it happens on line 239 of image-captions/vendor/imangazaliev/didom/src/DiDom/Document.php:

$this->type === 'xml' ? $this->document->loadXml($string, $options) : $this->document->loadHtml($string, $options);

I am using image-captions 1.0.0

newmedicine commented 6 years ago

Hi all, is there any workaround for this? I have tried defining the collection in the twig template blog.html.twig but that results in the same error:

{% set options = { items: {'@page.children': '/news'}, 'limit': 50, 'order': {'by': 'date', 'dir': 'desc'}, 'pagination': true } %}
{% set collection = page.collection(options) %}
rhukster commented 6 years ago

Is this still an issue with 1.0.2? I can't replicate it.