Hi all,

I am new. I am having an issue entering HTML into the "block body" fields. At first I was trying to reference an image

<img src="sites/all/themes/mystyle/image.gif"> 

this worked, but

<img src="sites/all/themes/mystyle/image.gif" align="center"> 

did not center my image.
I know align is depricated, but it was going to be a temporary fix until i had learned more about using CSS. I imagined I would enter this in the block itself:

<head>
<link rel="stylesheet" type="text/css" href="blockstyle.css" />
</head>

and have blockstyle.css center the image for me (which I don't know how to do), but I haven't even tried this yet because it seems the block HTML fields are abnormal. (btw I have selected "full HTML" in the input format section) Frustrated, i tried to put this on hold. I commented out the image

<!-- img src="sites/all/themes/mine/image.gif" -->

and now my header is displaying this "<!-- img src="sites/all/themes/mine/image.gif" -->" INCLUDING THE COMMENT TAGS!!

What gives?

Thanks for any info anyone can provide!
a

Comments

abaldor’s picture

Maybe I need a snippet?

Anyway, the block I am referring to is my header and I just want a centered picture in there. I don't understand why this is so hard.

abaldor’s picture

Hi I bet it's not cool to comment on your own post to bring it back to the top of the discussion threads, but I am really frustrated by this. Does anyone know what's up with the HTML fields in the block config? I know about setting a block's input format and also about configuring input formats under site configuration- i have made sure authenticated users (i presume this includes myself as admin) can use Full HTML. This hasn't made a difference.

I guess a simple, specific question is: Why isn't <!-- --> commenting out text? You can see this problem at http://www.somervillionaire.com/drupal-6.8/ top left.

Thanks

abaldor’s picture

ok, now i'm really confused. At http://www.somervillionaire.com/drupal-6.8/ i have removed the comment tags discussed in my earlier comment and the comment tags' contents. The image you see is CSSed into the background and attached so it scrolls with the page. I also went into the header block and created an in-line style sheet that gives margins to all paragraphs. These margins have only a top padding equal to the height of the background picture (203px). This starts the page content below the background image and has it scroll away with the page content.
header block HTML:(in header region)

<html>
<head>
<style type="text/css">
p {margin-top: 203px}
</style>
</head>
<p>
</p>

FYI background.CSS:

body
{ 
background: url('backgroundimage.gif') no-repeat scroll top center; 
}

This is a great work-around, indeed the image behaves like it is in the header, but this does not satisfy my desire to understand the underlying drupal block HTML rules. previously, I documented the above problem with the comment tags where drupal was publishing the <!-- --> instead of hiding it like a proper comment, but now it seems I am allowed to create a whole header (complete with an inline style sheet) within my header block? It makes no sense! What HTML tags can and can't I use in the header?

argh.
anyway, i could really use a knight in shining armour to come to my rescue or damsel in a shining chastity belt or whatever damsels wear when they some to the rescue.

Best regards,

TPerkins’s picture

Hey sorry no one ever replied.

The original post:

(NOTE: I added an ending '/', to keep with current web standards, no biggy.)

This would most likely only work on your frontpage, assuming that your drupal installation is not within a subfolder.
<img src="sites/all/themes/mystyle/image.gif" align="center"/>

You should try this (notice the beginning '/'):
<img src="/sites/all/themes/mystyle/image.gif" align="center"/>

If your'e drupal installation is in a subdirectory (http://www.mydrupalsite.com/somefolder/). Then you will need to do this instead:
<img src="/somefolder/sites/all/themes/mystyle/image.gif" align="center"/>

Your'e third option is to enable "PHP input" for the block and do this:
<img src="<?php print base_path();?>sites/all/themes/mystyle/image.gif" align="center"/>

For the HTML comment question:

I just tested this myself, and you are right, HTML comments are being HTML encoded (&lt;!-- comment --&gt;).
I have never ran into an HTML tag I could not use. My assumption is that HTML comments aren't actual tags..