Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Prismic 中,我在一个组中有一个富文本字段,我想将其检索为 HTML。我可以检索数据,但不能将其作为 HTML 检索。如何查询它以将其作为 HTML 取回?文档中没有这样的例子吗?
You need to put it in a foreach loop that loops through all entries in your group. Then the RichText::asHtml should work.
<?php foreach ($items as $item):?> <a href="#"><?= RichText::asHtml($item->text_block_in_your_group ?></a> <?php endforeach; ?>