3

I am using Joomla 1.5. and I am writing a blog in joomla and want to highlight some HTML and javascript code but when I save that article after inserting the HTML code as it is, it gets exicuted itself. I also tried it with codecitation plugin but no result. If you people have any solution then please reply.

gprathour
  • 14,813
  • 5
  • 66
  • 90
RoyalEnfy
  • 127
  • 1
  • 11
  • what was wrong with the codecitation plugin? – WooDzu Nov 30 '11 at 09:47
  • http://stackoverflow.com/questions/8306553/i-am-using-html-snippet-in-to-hightlight-html-and-javascript-code-in-blog-joomla/8311560#8311560 – SMacFadyen Nov 30 '11 at 11:00
  • I answered this question exactly how you should do it. Install the Blank Module extension/module, and put your code in there and load it in your article. – SMacFadyen Nov 30 '11 at 11:01
  • @WooDzu I don't know but even other plugin with same functionality is not working. Actually it is working well to highlighting other code but only problem with HTML and JavaScript. – RoyalEnfy Nov 30 '11 at 11:29
  • @SMacFadyen I have tried that also using Custom HTML module. But what the problem is that HTML code is executed in that custom HTML module also. – RoyalEnfy Nov 30 '11 at 11:32

5 Answers5

1

Use a <pre> tag it should work. e.g.

<pre>&lt;html&gt;&lt;\html&gt;</pre>
Sara
  • 14,098
  • 13
  • 34
  • 50
0

Sorry for coming late to the party. I used an extension called Easy Script. Just download, install and paste your script in your article manager and Boom. It even supports Bootstraps and other scripts as well.. Just give is a trial

Easy Script

Olasunkanmi
  • 902
  • 15
  • 23
0

In your blog try "& lt;" (without space) to write < and "& gt;" (without space) to write > in your HTML Code.

This syntax is used to write "<" and ">" symbols on some web page. Otherwise it will treat your code as part of the blog article and will show its output.

gprathour
  • 14,813
  • 5
  • 66
  • 90
0

You can use <pre> and <code> tags. Also Joomla has a native plugin to display code and syntax highlighting, based on the Geshi project. It's easy to use, just be sure it is enabled in your plugins config:

<pre lang="html" >
<p> some text </p>
</pre >

Hope it helps!

Flor
  • 111
  • 3
0

Use the a jQuery highlighter.

SMacFadyen
  • 3,145
  • 2
  • 25
  • 37