-
Notifications
You must be signed in to change notification settings - Fork 10
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
Configuration options for customised formats #43
Comments
Actually, the heavy-handed solutions may not be needed, as the mentioned TinyMCE features should work fine when added under
or multiline like this:
Is there anything that I missed, that makes this approach unsatisfactory? If not, I should probably treat this issue as the call to finally improve the frikkin' documentation, my limited availability unfortunately slows that endeavor... 🙃 |
I'm still at the "I don't need this yet" level of concern with this, so I'll accept your suggestion as absolute truth :) Does indeed sound like a documentation problem. Perhaps let's see if the original poster has any success with this method before closing .. ?? Cheers! |
Hi, I'm the original poster on the Grav forum. Many thanks @newbthenewbd for the amazing plugin, and to @hughbris for leading me here. I've tried the method mentioned above, adding style_formats to the parameters section of /user/config/plugins/tinymce-editor.yaml but do not see the entry that was added when then editing anything within Admin. I've checked within the Plugin's configuration panel, which appears to be able to see the added style_formats, but when editing the TinyMCE editor doesn't appear to show them as options. I don't think it's an admin caching issue, as I've added a value to fontsize_formats, which is shown when editing, so am not sure whether I'm missing anything, or what to try next? Many, many thanks for any help you can provide with this! |
This is the case because
Meanwhile, to add formats that will be visible on the
However, it should be noted that the block formats, set by the mentioned dropdown, are supposed to be exclusive - such that no two different such formats may be used at once. The above example featuring the Therefore, unless exclusive formats are to be added, it might be a good idea to change
After doing that, the |
Thanks so much for looking into this. I've tried what you suggest towards the end of your message (I think) but am still struggling. I'm now seeing the 'Formats' dropdown, but it's empty (in both the menu and toolbox dropdowns) This is what is now in my /user/config/plugins/tinymce-editor.yaml
Which shows with Admin as: and I'm sure it's something simple that I'm missing.. Any ideas what it might be though? I really appreciate your help with this! |
It seems that the |
It appears that it requires the following to be added after the 'style_formats_merge' line:
So that it reads:
Thanks so much for your help, @newbthenewbd and @hughbris ! |
Glad you figured it out together! I'll leave this for you to close if you want, @newbthenewbd . |
Hello! anyone can help me with table default styles?
this doesnt work, plz help |
Try |
Hi all, first: thanks a lot for this plugin! I am deeply diving into grav as another cms to work with and tinymce is a core issue with that. My question is: How can I achieve, that the chosen classes (works fine even with more than one selected), which are properly rendered in frontend, also appear within tinymce? E.g. I select a class for a grey background and another for a border for a paragraph, it works and looks fine in frontend. But in tinymce there is no change in appearance. Is there a possible configuration within tinymce-editor.yaml to load my own defined classes from C:\xampp\htdocs\grav-admin\user\themes\quark\css\custom.css?
to add my own classes to be rendered in tinymce? With all the problems concerning an upgrade of this plugin... Thank you very much for some hints! Greetings, Markus |
What should work is the content_css parameter, that can be configured in the admin panel or directly in
|
Hi newbthenewbd, |
Hi newbthenewbd, I tested your solution - but it did not work, although it looks plausible. What I additionally checked is a change in path. If your "are" within the plugin-folder tinymce-editor, you first would have to leave it to get into the user-path.
Both did not work. Afterwards I had a look at https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@content_css/, where "content_css" is mentioned. After reading it, I thought this file is more to change the appearance of the editor itself than to define the look of the editable content. Nevertheless I tried to put my custom styles into
But like adding my classes to user/plugins/tinymce-editor/css/editor.css it did not make a change. I would appreciate to get another tip. Thanks a lot. Greetings, Markus |
From the link I gave in my previous reply:
Therefore, it would seem that using a relative path is a no-go. We would hence have to follow the absolute path example from that link:
And what have I observed happening in practice? Well, apparently supplying:
...made it look for the file... Under https://cloud.tinymce.com/site/user/themes/laguna/css-compiled/template.css. So, yeah, whole entire URLs it apparently is, until a better solution is found with more time to spare? In the case of my dev instance:
Hopefully that works out for You, at least inasmuch as it does for me, which is kinda at best... 🙃 |
"Hopefully that works out for You" In case anyone has the question how to implement more than one css-file:
May I ask another question? If there is not a solution given yet, it might be a kind of feature request... (and perhaps should be removed from here to a new topic), but it still is related to the opening post. What's it all about: If you have lot of individual css-classes, it is a problem to keep them user-oriented within the "format"-dropdown. First you should name and group them by html-tags. That works fine, if a class is only for a certain tag. But what about classes, which suit for several tags? Then, this will not work so good. Is it possible to address those custom css-classes at the point where they are allowed? In another cms I work with, there it is a contextual supply of possible css classes. If you alter or set up a link, only the css-classes addressing links are shown. Not the ones which are given for images, ... I hope the image attached makes it a bit more clear, even if the field descriptions are German. Again: Thank you! :) |
It would seem that this is what You're looking for. Just insert the list using correct JSON (unlike the way it is in the documentation...), e.g.:
This website may be of help making the JSON correct and compacting it (JSON Template: Compact). Best of luck! 🙂 |
Wow! Thanks again for your response! Now I think I can tick off nearly every point of "convenience" for using tinymce... :) |
After a few hours of reading and trying: Awesome work @newbthenewbd ! Thank you for this plugin. |
[Confession: I've never used this plugin, though I plan to one day, and will be interested in heavily customising what content editors can do]
I'm passing on a post from Grav Forums as a feature request.
Probably best to read about it there, but here's a summary: the poster wants to add elements to the toolbar with custom classes, which is supported, and which I would also want to do (to provide alternatives for content editors, thereby discouraging custom inline styling).
I think I have provided a working solution by augmenting the base template, but this seems heavy handed. It would be great if certain options like this could be set in plugin configuration, and then iterated in the base template JS init.
What do you reckon? Happy to have a go at this and submit a PR if I get sufficiently encouraged/motivated.
The text was updated successfully, but these errors were encountered: