Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Code block does not work, when editor is nested within structure #229

Open
trych opened this issue May 1, 2020 · 1 comment
Open

Code block does not work, when editor is nested within structure #229

trych opened this issue May 1, 2020 · 1 comment
Labels
type: bug 🐛 Issue is a bug; PR is a bugfix

Comments

@trych
Copy link

trych commented May 1, 2020

Describe the bug
When an editor field is nested within a structure field, I cannot use the code field properly, not even when using the pretty: false option as advised elsewhere.

I am able to create a code field and enter a code snippet just fine, but when I reload the panel page, the code actually disappears (it's not displayed at all in the editor block, see screenshots).

Before reloading:
20200501-172427_Screenshot_GoogleChrome

After reloading:
20200501-172443_Screenshot_GoogleChrome

(Edit: Also, now I noticed in the panel's console it gives me this error: block component does not exist: paragraph).

In the content file, the code is now listed like this:
20200501-172611_Screenshot_SublimeText

And when I try to use this in my template, using

<?= $page->teststructure()->toStructure()->first()->testeditor()->blocks()  ?>

it renders the literal JSON string like this in the frontend:
20200501-172903_Screenshot_GoogleChrome

Would be great, if I could somehow be able to use code blocks within editor fields within structure fields as well! :)

@bastianallgeier bastianallgeier added the type: bug 🐛 Issue is a bug; PR is a bugfix label Jul 15, 2020
@tststs
Copy link

tststs commented Sep 15, 2020

@bastianallgeier any news here? it seems this issue is not only for a code block. we currently try to upgrade our projects to kirby v3 and trying to render editor content via ->blocks(). inside a structure the result is always that it renders the JSON structure instead of HTML.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug 🐛 Issue is a bug; PR is a bugfix
Projects
None yet
Development

No branches or pull requests

3 participants