How to insert HTML/javascript/css code in joomla article - joomla

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.

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

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.

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!

Use the a jQuery highlighter.

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

Related

What is the <jdoc:include>? Is it HTML or PHP?

< jdoc:include >
But I do not know how the above works. I mean, how is it compiled?
How does the HTML Code recognize that this is related to Joomla!
It is Joomla syntax. <jdoc ... is processed by the Joomla engine to output specific information. You can read more about it here.
The "HTML code" really has nothing to do with it, it is compiled by Joomla before serving the page to the browser.

Joomla TinyMCE deletes empty span

I want to use following tag
<h4><span class="icon-phone"></span></h4>
but TinyMCE from Joomla always deletes it, when i save it.
I find the solution that i have to add span[*] to "Extended Valid Elements" in Options from TinyMCE in PluginManager. but it doesn't work. It always delete it again and again. I searched here for a while and found some articles which was similar to my problem but doesn't solve it.
I use Joomla Version 3.3.6 and the plugin is 4.1.2.
Hope somebody can help.
Best Regards,
Dennis
Welcome to TinyMCE, my most hated editor ever.
I've had the same problem multiple times and I believe it's because the editor expects content within the element. So try the following:
<h4><span class="icon-phone"> </span></h4>
is simply a non breaking space
go to: Joomla! administration - Extensions - Plugins - edit Editor - TinyMCE
Set the following parameter:
Extended Valid Elements: span[class|style]
This works for me in Joomla! 3.5 (plugin version 4.3.3)

Joomla 3 modifying < and > when I save articles - breaks php

I'm running the current JCK as the default editor on Joomla 3.2 with PHPCode 2.5 and I have the JCK option to convert HTML entities turned off as well as the option to force simple '&' turned on.
In this configuration I can create and edit articles and custom HTML modules containing PHP just fine... the syntax highlighting, etc., all works as expected. I can switch back and forth between WYSIWYG editing mode and SOURCE editing mode and everything remains as I edited it.
However, whenever I save the article/module the '<' and '>' characters in the PHP code have all been converted to their corresponding '<' and '>' HTML entities and the PHP code won't run when loaded on the site (for the obvious reasons).
I have searched high and low and can't figure out what setting I'm missing, or what extension I need, to be able to fix this so I can execute custom PHP in my articles/modules.
I presume the same would be true of javascript since it, too, uses these symbols in the source.
Anyone?
EDIT: For the record, I was able to switch to the RokPad editor and save the PHP that way without it breaking. However, I know I should be able to do this directly inside JCK. I used to be able to do this in Joomla 1.6, I just can't seem to make it work in Joomla 3.
Try this,
Check this extension this may help or another methods you can check
How to include html or php codes into joomla article
Hope its helps..

C++ syntax highlighting html generator

I'm writing blog posts for my company blog and I would like code snippets to show up with syntax highlighting.
All I can do is write html/css.
Is there any app/webapp that will let me paste in a c++ code snippet and get a chunk of html with the highlighting?
Try this Online syntax highlighting Site, and especially the C++ section.
You paste in your code and it does the hard work.
I use emacs M-Xhtmlize-bufferRET. Also enscript is very powerful to generate colorized HTML from many source code formats.
For others looking for a solution to this problem - you should checkout:
http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html
It's a really easy "SyntaxHighlighter for Blogger" tutorial with screenshots and everything.
You should be up and running in only a few minutes.
Also, for your C++ application, make sure you have the shBrushCpp.js library referenced in your <head></head> section like this:
<head>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
</head>
Have a look at http://www.syntaxhighlight.com - supporting 222 languages. Paste your code and get the formatted html.

Adding whitespace to web page source so that I can read it

I'm curious about the web page I'm viewing.
I use the "view--page source" and get a window with the html.
I cut and paste this into notepad++.
I manually parse through adding whitespace to make it readable to me.
Is there a better way to do the last step? I'm hoping something has been written which automates this process, giving the user a readable version of the source file.
Thanks for any help.
-bill
Try HTML Tidy
Numerous editors have support for HTML Tidy (if you use an editor that knows about HTML, check the menus or documentation); alternatively, you can run HTML Tidy from the command line.
There is HtmlTidy, which works in Notepad++
http://tidy.sourceforge.net

Resources