Title: Source Code Button
Last modified: November 1, 2019

---

# Source Code Button

 *  [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/source-code-button/)
 * 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](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/source-code-button/#post-12090046)
 * Please look at the image here:
 * [https://www.dropbox.com/s/1onuqi2kgplqx4m/SourceCode.png?dl=0](https://www.dropbox.com/s/1onuqi2kgplqx4m/SourceCode.png?dl=0)
 * As you can see, no formats are listed.
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/source-code-button/#post-12090063)
 * I found this [article](https://www.tiny.cloud/docs/plugins/codesample/) 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](http://prismjs.com/download.html)
   > 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 6 years, 7 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
    -  This reply was modified 6 years, 7 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/source-code-button/#post-12092686)
 * 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.

 * ![](https://ps.w.org/tinymce-advanced/assets/icon-256x256.png?rev=971511)
 * [Advanced Editor Tools](https://wordpress.org/plugins/tinymce-advanced/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tinymce-advanced/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tinymce-advanced/)
 * [Active Topics](https://wordpress.org/support/plugin/tinymce-advanced/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tinymce-advanced/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tinymce-advanced/reviews/)

## Tags

 * [source-code](https://wordpress.org/support/topic-tag/source-code/)

 * 3 replies
 * 1 participant
 * Last reply from: [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/source-code-button/#post-12092686)
 * Status: not resolved