3
votes

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.

5
what was wrong with the codecitation plugin? - WooDzu
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
@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
@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

5 Answers

1
votes

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

<pre>&lt;html&gt;&lt;\html&gt;</pre>
0
votes

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.

0
votes

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!

0
votes

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