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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
webchicklet
New Member
New Member
Posts: 3
Joined: Sat Mar 22, 2008 6:15 pm

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

Post 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?
Last edited by webchicklet on Fri Apr 11, 2008 8:17 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

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

Post by Nullig »

I don't understand why you would want the {literal} tags.

Nullig
webchicklet
New Member
New Member
Posts: 3
Joined: Sat Mar 22, 2008 6:15 pm

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

Post 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.
Last edited by webchicklet on Fri Apr 11, 2008 7:49 pm, edited 1 time in total.
webchicklet
New Member
New Member
Posts: 3
Joined: Sat Mar 22, 2008 6:15 pm

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

Post 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.  :)
Post Reply

Return to “Layout and Design (CSS & HTML)”