Tutorial

You will probably notice here on this site that I sometimes provide example code. Getting it along with all the opening and closing brackets to display properly can be a challenge. This is because your browser will read it as html and want to parse, render, or output the html.


At some point you may want to provide or post the actual html code without rendering it either on your Dolphin web site or elsewhere. You might want to give your members an example of html code. Maybe you are posting a question and want to show the code you are using, so others can provide comment or suggestion.


There are a few ways you can do this. One option is to use textarea code. Textarea can work in many situations. It can seem slightly time-consuming, but not terribly long.

Example textarea code:


<textarea name="comments" cols="60" rows="3">
<a href="http://www.dialme.com">Dialme.com</a>
</textarea>

Which will actually be output in a web browser as:



Another possible option that is very simple to use is <XMP> and </XMP> tags between html code.

Example using <XMP> and </XMP> to show html code as text:

<XMP>
<a href="http://www.dialme.com">Dialme.com</a></XMP>

With <XMP> and </XMP> the output will be text and would look like:

<a href="http://www.dialme.com">Dialme.com</a>


Without <XMP> and </XMP> the output will be rendered html and look like:

Dialme.com


The <XMP> and </XMP> tags can be used very quick and easy to show and post html code without rendering it as html. It is supported by most browsers. Although I cannot test them all. It is a bit faster and easier than making a textarea box.


You never know when you may need to post html code as text whether on your own site or somewhere else. Even if you don't have the need for this today, file it or bookmark it for future reference. It could come in handy or be useful for you one day.

Note:
You can manually make the brackets by using lt's and gt's such as:

&lt; (will output a < symbol or character)and&gt; (will output a > symbol or character)

But typing all those &lt; and &gt;'s will be a real pain, confusing and time-consuming.

Example:

&lt;html&gt; &lt;br&gt; &lt;head&gt; &lt;br&gt; &lt;title&gt;My Title&lt;/title&gt; &lt;br&gt; &lt;/head&gt;


Would be output as:
<html> <br> <head> <br> <title>My Title</title> <br> </head>

So it's easy to see how this could be time-consuming just to show some html code. The <XMP> and </XMP> tags are really the way to go for simplicity.


I post html and other code here at this site and other sites fairly often. Because the type of tutorials and blogs I post are generally related to Boonex Dolphin and other web site related tips. It is a common practice for me. I thought I'd pass this along to everyone just in case you might get some use out of it.


 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Sponsored Links
Recommend