Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Custom Editor Button

Solved by Simon View solution

Started by Simon 5 years ago · 5 replies · 813 views
5 years ago

In the main editor is there a simple way to add a button?
I would like to to add a <pre></pre> button to make using the prism highlighting easier.

It seems such a simple thing but I cannot find a plugin or even guide to achieve this.

Thanks for any suggestions.

5 years ago

Thank you, I have had a look and it would add a button but it prompts for entry instead of using the text selected.
I do not know enough to convert it.

5 years ago Solution

I have a workround, I setup hotkeys to type the tags instead.

5 years ago

But it has what you need if you're looking for code wrapping or just adding a markdown tags. All is in the if (videoURL) {} condition. Just requires some adaptation and changes.

Anyway, it's good you found a solution that satisfies you

3 years ago

In case anyone stumbles across this thread and like me wants to add buttons:
I searched Grav's files and found the button configuration here:

/user/plugins/admin/themes/grav/js/admin.min.js
and
/user/plugins/admin/themes/grav/app/forms/fields/editor/buttons.js

last edited 08/04/23 by Shizuka Kanegawa

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 95 15 hours ago
General · by pamtbaau, 20 hours ago
1 61 20 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 356 5 days ago
General · by Duc , 6 days ago
3 44 6 days ago