You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#117106 Code Sample additional Languages not working

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Thursday, 06 March 2025 14:05 GMT

nisfero

Hello,

I'm using the "Code Sample" plugin and eveyrthing works fine with default provided languages in the list. i'm able to use my own prism.js / prism.css files for the layout etc.

I now would like to add support for more languages than default provided ones (csv mainly for now, but I may also add Bicep and other ones later on) but when I try to add languages (they are included in my prism files) it doesn't show up in the editor.

Here are some screenshots:K28hVtQ.png

In my Editor:

rNgIwty.png

What I already tried:

  • Changing prism files by new ones in plugin parameters and on the plugin itself
  • Clearing site cache
  • Clearing browser cache
  • In-private navigation
  • Disabling/enabling everything (Plugin and JCE itself)

Am I missing something ?

Thanks for your help,

Steven

Ryan

Please try CodeSample 2.0.0 Beta - https://www.joomlacontenteditor.net/downloads/plugins/development/editor-codesample-dev

You can now specify Custom Languages in Editor Profiles -> Plugin Parameters -> CodeSample, of the Use Custom Prism Assets option is set to Yes. You must specify custom Prism assets in the CodeSample profile parameters, and in the CodeSample plugin parameters.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

nisfero

Hello Ryan and thanks for the update.

I tried the updated beta version but it still doesn't work. Here's my configuration with the beta version:

codesample-beta-pluginsetting.png

codesample-beta-editorsetting.png

codesample-beta-edit.png

I tried :

  • Relative url, and full URL ( prism.js & prism.css files are accessible with browser with no issues)
  • Clearing all cache / In private

When I check using console, I have a message "Prism successfully loaded" but it seem to keep loading the base "prism.min.css" and "prism.min.js" files included with the plugin regardless of the setting set to "Yes" to use custom Prism files.

Complementary info:

I have to also mention that this version includes a new "Copy to clipboard" feature that breaks existing prism script plugin I was using to copy my code on the front-end website which confirm Prism custom script are working on the front-end part with no issues except the "copy to clipboard" option that made me rollback to current stable version of the codesample plugin. Here's the part of Prism Plugin option i'm using

codesample-beta-prismpluginsetting.png

  • Copy to clipboard doesn't work anymore
  • Doesn't show up language anymore ("Show Language" plugin)

Steven

 

Ryan

Please try CodeSample 2.0.0 Beta 2 - https://www.joomlacontenteditor.net/downloads/plugins/development/editor-codesample-dev

Clear your browser cache after install.

Relative url, and full URL ( prism.js & prism.css files are accessible with browser with no issues)
Clearing all cache / In private

When I check using console, I have a message "Prism successfully loaded" but it seem to keep loading the base "prism.min.css" and "prism.min.js" files included with the plugin regardless of the setting set to "Yes" to use custom Prism files.

Use a relative url, but you must also set the Custom CSS and Custom Script file in the plugin parameters (System -> Manager -> Plugins -> Code Sample) for it to be used in the front-end, if you are not loading it yourself.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

nisfero

Hello Ryan,

Thanks for the updated version it brings back the copy and language view on the front end. Front end is ok since the begining but the editor still doesn't show languages added to the editor options.

Here's an example with CSV, Bicep and Dax added and part of my custom Prism Script.

2025-03-05-09-41-30.png

I can't find any of all 3 added languages in editor :

2025-03-05-09-40-36.png

When I go in code view and specify manually something like "language-csv" it works in my front end so prism part is ok on front end.

If it's easier for your I can provide you with an access to the website, it's a brand new one i'm working on right now and not online yet.

Steven

Ryan

Please send me a login - https://www.joomlacontenteditor.net/contact/site-login

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan

I have fixed this on your site with an install of Code Sample 2.0.0 Beta 3 - https://www.joomlacontenteditor.net/downloads/plugins/development/editor-codesample-dev

Please confirm.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

nisfero

Hello Ryan,

Thanks this updated version fix the issue indeed ! 😁

 

Only thing not working atm is the "Copy" code option but i know you're working on it and I can go ahead without this feature for now.

 

Thanks for you help and have a nice day,

Steven

Ryan

Only thing not working atm is the "Copy" code option but i know you're working on it and I can go ahead without this feature for now.

Your custom Prism JS and Prism CSS must include the Copy to Clipboard plugin.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.