newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

tinymce does not replace all markdown fields #11

Closed ponderboy closed 6 years ago

ponderboy commented 6 years ago

Well, if I define a editor form field within my theme blueprints it will not replace that with tinymce but still use the regular markdown. It's a pitty because I hardly use the regular content field.

Or maybe I am missing something?

ponderboy commented 6 years ago

Okay, figured it: instead of: type: editor use type: tinymce in your blueprints. Cool!

ponderboy commented 6 years ago

Mhm, if I use above mentioned solution, I can't add labels anymore: label: My Text Field will not show up on the page edited in the admin panel.

mario-neuhold commented 6 years ago

Hey @ponderboy,

I've just started with Grav and I'm also using this plugin. A quick fix for the missing label is to add

{% block label %}
    {% if field.label %}
        {% set hint = field.help ? 'data-hint="' ~ field.help|tu|raw ~ '"': '' %}
        <div class="form-label form-field hint--bottom" {{ hint }}>{{ field.label|tu|raw }}</div>
    {% endif %}
{% endblock %}

at the top of \user\plugins\tinymce-editor\templates\forms\fields\tinymce\tinymce.html.twig.

I found this snipped in the file \user\plugins\admin\themes\grav\templates\forms\fields\editor\editor.html.twig.

By editing the file mentioned above, the changes will be gone after a plugin update. I'll have a look if there's another way to achieve this.

Hope this helps :)

ponderboy commented 6 years ago

Hello Mario,

hihi, thanks. I did just the same yesterday, in the end. I also 'hacked' some of the CSS files of the plugin to achieve the same color that grav is using for its textfields and icons. Otherwise the black looks quite harsh compared...

newbthenewbd commented 6 years ago

How dare those people destroy the plugin's beauty?!? It was totally explicitly implied that it is certainly and unbelievably wrong to look at, let alone modify anything in the code! Time to polish the EULA, start charging $6.99 for each download and just kidding, sounds like the proper way to patch it has been applied (this one time, beware! :smile:), although I'm not really understanding as to what exactly is broken without it. (That, after all, was the original reason as to why I haven't included that snippet...)

Will try to push a fix soon.

newbthenewbd commented 6 years ago

Fixed in v1.1.7, hopefully.

mario-neuhold commented 6 years ago

Thanks for the quick fix! With that snipped we can "label" our TinyMCE Editors if we put more than one on a single page :) Without it, they are just random editors without a known purpose.