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

Editor "Preview" button not working as expected with Modular content pages #254

Closed
paulhibbitts opened this issue Nov 4, 2015 · 14 comments

Comments

@paulhibbitts
Copy link
Contributor

If the "Preview" button is clicked when editing a modular content page the UI of the editor itself seems to be presented along with the content preview.

Snapshots attached:
edit _reminders cmpt-363 2

edit _reminders cmpt-363

@flaviocopes
Copy link
Contributor

Uhm strange! I don't have this problem. Which theme are you using?

@paulhibbitts
Copy link
Contributor Author

It didn't occur to me it might be theme related. I am using Materialize with a fair bit of inherited theme elements.

@flaviocopes
Copy link
Contributor

Maybe put your user/ folder on Dropbox and post me a link on Gitter so I can try myself

@bobrocke
Copy link

bobrocke commented Nov 5, 2015

I'm the author of the Materialize theme, and don't have that problem on my test set-up. I did have some trouble, since fixed, with my theme's CSS intruding on the Admin. Now I can't remember how I fixed it! I'll keep looking; maybe there's a clue there.

@paulhibbitts
Copy link
Contributor Author

Thanks Flavio and Bob, here is a link to the user folder if that helps: https://www.dropbox.com/s/8u2pbz8ixu2h8q2/user.zip?dl=0

@flaviocopes
Copy link
Contributor

I installed and recreated, find the cause in this line: https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Page/Page.php#L1634

Commenting that, it works. Not sure why that is needed. @rhukster have an explanation at why is that needed?

Anyway this behavior is not happening on my other installs, I thought it could be related to the inherited theme and the fact it does not provide a default.html.twig (but adding it makes no difference, so I'm not sure).

@rhukster
Copy link
Member

@flaviocopes can you let me know what that line is again? It doesn't match up anymore. Cheers.

@flaviocopes
Copy link
Contributor

@flaviocopes
Copy link
Contributor

PR getgrav/grav#460 fixes the issue without modifying the behavior on the frontend. Probably not the best way to handle it?

@rhukster
Copy link
Member

I'm a bit confused. Does this only happen for Materialize theme? Can this be replicated in Antimatter? If not then I think this fix could cause more problems than it fixes. That process is there for a legitimate reason (even if i can remember exactly what that reason is!)

@flaviocopes
Copy link
Contributor

Tested, it's not the theme, even with antimatter with the default modular pages (text for example), all works fine. If adding another one (with any name), it outputs this strange layout.

@flaviocopes
Copy link
Contributor

For example I tried duplicating templates/modular/text.html.twig to templates/modular/text2.html.twig, and using a text2.md page file, the bug is replicated

@rhukster
Copy link
Member

Ok was a bit tricky to track down, but found it!

@paulhibbitts
Copy link
Contributor Author

Great to hear, thanks!

flaviocopes added a commit that referenced this issue Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants