By Aravind Prakash on Thursday, 08 December 2016
Posted in General
Replies 6
Likes 0
Views 215
Votes 0
Hi,

I wanted to change the CSS style for "markup" style in the code button in a BBCode editor. I have found that it is defined in
com_easydiscuss/themes/.../styles/style.css and
com_easydiscuss/themes/.../styles/style.failsafe.css

How do I override these files ?

Also how do I change the default "markup" text to something else so that when a user clicks on the button, it shows



Thanks,
Aravind
EasyDiscuss uses prism.js for it's built in syntax highlighter. You can refer to the following files,

/media/com_easydiscuss/script/prism.js
/media/com_easydiscuss/styles-lib/vendors/prism/prism.less
·
Saturday, 10 December 2016 14:42
·
0 Likes
·
0 Votes
·
0 Comments
·
I wanted to change the CSS style for "markup" style in the code button in a BBCode editor. I have found that it is defined in
com_easydiscuss/themes/.../styles/style.css and
com_easydiscuss/themes/.../styles/style.failsafe.css

How do I override these files ?

Actually you do not need to override this css file, you can just put your custom css code into your template override file, so it will load these custom css on your site.
JoomlaFolder/templates/TEMPLATENAME/html/com_easydiscuss/css/custom.css <- you have to manually create these new folder/file.

Also how do I change the default "markup" text to something else so that when a user clicks on the button, it shows

You have to modify on this file ->
JoomlaFolder/administrator/components/com_easydiscuss/themes/default/structure/settings.js

// LINE 141
openWith: '[code type="markup"]\n',
·
Thursday, 08 December 2016 10:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Do I have to recompile the CSS after creating custom.css ? I am guessing that if I need to override a CSS class, then I have to describe the class differently in the custom.css file.

Also, I have seen an option to enable syntax highlighter in the backend settings, how do I apply a syntax style for a particular language. Like for geshi, I can have a separate file for every language, and mention the language instead of "markup". If you can point me to some sample files, that would be great.

Thanks !
·
Thursday, 08 December 2016 13:26
·
0 Likes
·
0 Votes
·
0 Comments
·

Do I have to recompile the CSS after creating custom.css ? I am guessing that if I need to override a CSS class, then I have to describe the class differently in the custom.css file.

Actually no need to compile again, but you have to specify the class for your custom css.

Also, I have seen an option to enable syntax highlighter in the backend settings, how do I apply a syntax style for a particular language. Like for geshi, I can have a separate file for every language, and mention the language instead of "markup". If you can point me to some sample files, that would be great.

I think you can use following php code in order to support multilingual.

openWith: '[code type="<?php echo JText::_('COM_EASYDISCUSS_BBCODE_MARKUP_CODES');?>"]\n',

Then create this language constant "COM_EASYDISCUSS_BBCODE_MARKUP_CODES" into Joomla language override. You can refer on this documentation : https://docs.joomla.org/J3.x:Language_Overrides_in_Joomla
·
Thursday, 08 December 2016 19:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I figured that my custom.css is added before style.min.css in the link href order, and hence my changes are not visible. I am a little unfamiliar with Joomla, wonder if you would know where I can edit the order, or some other workaround.

Thanks for the code on "markup". How do I specify the keywords and the color that goes for each keyword thereby creating a "syntax highlighter" scheme that can be applied to markup ?

Regards,
Aravind
·
Friday, 09 December 2016 12:15
·
0 Likes
·
0 Votes
·
0 Comments
·
PS : I see that CSS classes "token", "tag", "punctuation" are applied as necessary for syntax highlighting. So I am guessing that there's a parser which will compare each word in the code section with a table of keywords, and apply these CSS classes accordingly. So if I wanted to write a syntax highlighter for a different language, then I guess I might have to create a similar table with keywords of my new language and let the parser access that.

So, it would be really helpful if I could find out how to do just that.
·
Friday, 09 December 2016 13:34
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post