HTML in posts breaks my template

JackZero - July 12, 2009 - 13:05

I would like to know what I can do to use <div> and <h1> tags inside posts. Nothing seems to work. When I use this in my posts it breaks the whole template/site. <div> or <h1> . On the preview I see it does the same here. I need to write code examples inside the <code> tags but it doesn't work. Does anyone know of a way do do it without using Wordpress insted of drupal?

Edited by WorldFallz - added additional <code> tags.

?

yelvington - July 12, 2009 - 13:31

Since your post is mangled by failure to use the code tags, it is unclear what you are trying to accomplish.

Drupal stores whatever you enter.

Output is filtered when the item is rendered. You can configure the filtering. You can add filters such as codefilter from the contributed modules collection. Drupal.org uses Codefilter. It lets me do this:

<h1>This is an h1</h1>

... as a readable representation by surrounding the section with <code> and <code> tags. If I don't use those tags, I get:

This is an h1

(Codefilter works with PHP code, as well.)

<?php

echo 'Hello, world';

?>

There are dozens of downloadable filters including some, such as htmLawed, that enforce strict rules preventing your users from inserting invalid HTML.

Thank you but I was hoping to

JackZero - July 12, 2009 - 14:03

Thank you but I was hoping to not use any modules. I don't like constantly updating them. I do know about using code inside < code > tags but it doesn't work for < div > < h1 > etc. unless I make spaces like here. Looks a bit ugly on my pages. Can you tell me what does escaping mean. How do I escape the tags so I can use them inside < code > tags like standard html?

 
 

Drupal is a registered trademark of Dries Buytaert.