Extra: TinyMCE Rich Text Editor v2.0.9

I’m trying to customize (i.e. remove) some of the default formatting options, specifically the forecolor, background color, fonts, and font sizes options with a custom external file. With the Tinymcewrapper extra I could manage such things quite easily but with this new(er) / different plugin things are setup a bit differently and my efforts have had no effect so far. Well, I was able to add some templates which was easy but beyond that I’m stuck.

MODX v3.0.5

Take a look at this topic:

It seems the link in that response is no longer correct. So try this one:

Yes, I’ve seen those docs, I’ve been using them as a guide but I can’t get it to work.

I already have an external file configured (tiny-config.json) via system settings that contains a couple templates, which work. But I’m not sure if the menu / format code can be included in the same file or if it needs to be separate. Every time I add anything to the template file (below) it breaks and has no effect on the format menu.

{
	"templates": [
		{
			"title": "Definition List",
			"description": "Insert Definition list",
			"content": "<dl><dt>Definition Term 1</dt><dd>Definition Description</dd><dt>Definition Term 2</dt><dd>Definition Description</dd></dl>"
		},
		{
			"title": "Horizontal Rule",
			"description": "Insert Horizontal Rule",
			"content": "<hr></hr>"
		}
	]
}

Put everything into the same file. Make sure that it’s valid JSON.
It should look something like this:

{
	"templates": [
		{
			"title": "Definition List",
			"description": "Insert Definition list",
			"content": "<dl><dt>Definition Term 1</dt><dd>Definition Description</dd><dt>Definition Term 2</dt><dd>Definition Description</dd></dl>"
		},
		{
			"title": "Horizontal Rule",
			"description": "Insert Horizontal Rule",
			"content": "<hr></hr>"
		}
	],
    "menu": {
        "format": {
            "title": "Format",
            "items": "bold italic underline"
        }
    }
}

Ah, my menu code was correct but I had inserted it within the closing ], of the template. I moved it out and now it works.

Thank you.

@halftrainedharry

On a side note I noticed with the definition list template code above that once the code is inserted if I highlight the entire definition list and delete it then look at the source Tiny always leaves the <dl></dl> tags behind so I have to manually delete them from the source. Have you noticed this with your own templates?

I’m trying to determine if this is an issue with TinyMCE or something to do with my template code.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.