Page 1 of 1

[solved] Using both Literal and Code tags at the same time...

Posted: Fri Apr 11, 2008 6:52 pm
by webchicklet
This is actually in reference to an old post located at http://forum.cmsmadesimple.org/index.ph ... 044.0.html

I know this is an old topic, but my question is directly related to it.  If someone were to want to do both of the following:

1.  Display html code without rendering it
and
2.  Display that with a certain style (look and feel)

One would probably leap to the assumption that one should combine both the tags and the {literal} tags, wouldn't one?  like this:

{literal}{/literal}

Unfortunately, my tests seem to show that this won't work.  If I wrap the tags around the {literal} tags, then the literal tags seem to no longer function.  In other words, my html code displays with the correct style (based on the code tags I used), but they are not ignored, and therefore the code is rendered, rather than displayed. 

Am I making sense?

How does one both display html code without rendering it (as using the literal tags would do) AND display it with a special style (such as the code tags would do)?  It appears as though only one or the other can happen, but not both.

Am I just missing something?  Or is it just not possible?

Re: Using both Literal and Code tags at the same time...

Posted: Fri Apr 11, 2008 7:00 pm
by Nullig
I don't understand why you would want the {literal} tags.

Nullig

Re: Using both Literal and Code tags at the same time...

Posted: Fri Apr 11, 2008 7:42 pm
by webchicklet
Because I want to display some code (without processing it).  For example, let's say I wanted to show someone how to bold some test in HTML.  I would want them to be able to see the code (as if I were escaping the brackets).  I don't want the code to actually process.  I just want them to see it:

Code: Select all

<b>bold text</b>
but i also want that to have a special style (stand out and look different than the rest of the text).

UPDATE: I now realize that putting literal tags around html does nothing.  The html is still processed.  /sigh...

So, now I need to know how to display html without processing and with special formatting.  Not sure it's possible.

Maybe I'm looking for the wrong thing.  I need to escape the left and right angle brackets, really.  I could do it manually I suppose, but that would be a bear.

[SOLVED] Re: Using both Literal and Code tags at the same time...

Posted: Fri Apr 11, 2008 8:12 pm
by webchicklet
I've managed to answer this one for myself.

To display, but not process the html code, wrap the code in tags.

Then just add a style for xmp to the css.

Done.  :)