Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component registered as Snippets gets not rendered #4

Open
kay899 opened this issue Aug 2, 2017 · 1 comment
Open

Component registered as Snippets gets not rendered #4

kay899 opened this issue Aug 2, 2017 · 1 comment

Comments

@kay899
Copy link

kay899 commented Aug 2, 2017

Hi,

I try to use a component as a snippet with this Plugin. I have registered the component also as a page snippet and I can insert it via the RichEditor. Configuration value are stored correctly.

But after that this snippet gets not rendered. I tried to do the same with a snipped made of a partial and this is working.

While debugging I found that SnippetParser in line 36 outputs "false", instead of the snippet rendering:

$generatedMarkup = $controller->renderComponent($snippetCode);

So it seems my snippet gets not found, if it is a component.

Is there any other registration or special request needed to use also components?

@Fl0Cri
Copy link

Fl0Cri commented Aug 28, 2017

I got the same problem.

I've fount that $controller->renderComponent() doesn't allow to render components that are not included in the layout (or CMS page).

The quick fix would be to include the component in the layout where you want the snippet to be rendered.

I've made a PR to dynamically load the component in the layout before rendering the snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants