• Firstly, thank you for this excellent plugin! It is doing exactly want I want and more! Fantastic. I will do a review soon for you.

    I am customising the TinyMCE toolbar and when I opt to use the <> Source Code button it shows a pop-up window but that is it. I understood it would show some code formatting styles to choose from in a list, but I see nothing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Chuckie

    (@ajtruckle)

    Please look at the image here:

    https://www.dropbox.com/s/1onuqi2kgplqx4m/SourceCode.png?dl=0

    As you can see, no formats are listed.

    Thread Starter Chuckie

    (@ajtruckle)

    I found this article about this subject and it stated:

    codesample_languages
    This configuration option enables you to set a list of languages to be displayed in the languages drop down.

    The sample code they had was:

    tinymce.init({
      selector: 'textarea',
      plugins: 'codesample',
      codesample_languages: [
    		{text: 'HTML/XML', value: 'markup'},
    		{text: 'JavaScript', value: 'javascript'},
    		{text: 'CSS', value: 'css'},
    		{text: 'PHP', value: 'php'},
    		{text: 'Ruby', value: 'ruby'},
    		{text: 'Python', value: 'python'},
    		{text: 'Java', value: 'java'},
    		{text: 'C', value: 'c'},
    		{text: 'C#', value: 'csharp'},
    		{text: 'C++', value: 'cpp'}
    	],
      toolbar: 'codesample'
    });

    I tried to set the codesample_languages value by using the Advanced TinyMCE Configuration plugin but it didn’t appear to resolve the issue.

    The above article also states this:

    You need to add prism.js and prism.css to your page in order to get the syntax highlighted code samples on your webpage (as created by the Code Sample plugin). The Code Sample plugin uses the following languages: markup, javascript, css, php, ruby, python, java, c, csharp and cpp. You can generate the prism.js and prism.css files on the download page at the Prism website.

    I assume that I am lacking these support files but i don’t really know what to do. I look forward to any help in resolving this issue.

    I am really only interested in these code styles:

    • CSS
    • HTML
    • XML
    • XSL
    • This reply was modified 5 years, 4 months ago by Chuckie.
    • This reply was modified 5 years, 4 months ago by Chuckie.
    Thread Starter Chuckie

    (@ajtruckle)

    I was partly successful. I added prism to my wordpress website. Then I added the codesample plugin to the right folder (v4.9.4).

    I was unable to show the code sample button on the toolbar but it did show in the menu.

    My issue now is that if I paste in XML into this pop-up window all the syntax gets stripped and I end up with just the text.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Source Code Button’ is closed to new replies.