Hi

I know this seems absolutely stupid question to ask. But i am trying to create a block that displays the site emblem.

First i tried editting the theme .css and page.tpl.php files. I couldnt achieve anything.

Then i created a block and put the line Only local images are allowed.. But all this created was rectangle in the desired location, but no picture.

Please help me this. I am quite baffled by this.

Thanks

Sameer

Comments

nickmaynard’s picture

here's what i do.

i use cck and make a new content type called 'block image' or whatever. i give it an image field. then i create a 'block image' and upload an image with it.

then i make a 'node-blockimage.tpl.php' file and get rid of everything but the tag that pulls up the content.

then i go to contemplate and make the teaser and body only display the picture.

then i make a view, enable the block option, and have it only show nodes of the type 'block image'.

i go to the blocks admin menu and put my new view in the right sidebar or whatever, and there it is!

this isn't the quickest, easiest, or most elegant way to do it, by any stretch of the imagination, but it'll get the job done. anyone else want to offer a simpler way?

sameersegal’s picture

Hey nickmaynard,

Why isnt basic html working?
Isnt creating a new block and adding html input the same as adding a new page.

Another thing, what is the cck module used for?

Sameer Segal

avolve’s picture

as for your block, you might not have the correct input format (filter) set. Setting this to html for that block should solve the issue

Otherwise, you could hardcode your theme as well, you just need to ensure you have the path correct for the image.

cheers,
c.

avolve designs | ethical by design

sameersegal’s picture

Hi avolve,

I did set the input filter to "full html".

Path of the picture: drupal-4.7.6/files/logo.gif

What would be the correct path for the picture to use in the block while i am adding a new block.
What would be the correct path for the picture to use in the theme css

(I even tried copying the image to the theme image folder and then calling - it didnt work)

Thanks
Sameer

syquest’s picture

1) Block with Admin Full HTML input

Enter following in Block body:
<img src="/files/logo.gif" />

...or leave the Block body empty and use CSS

2) CSS (replace "n" with block number):

Add following to theme style.css:

#block-block-n {
	background-image: url(/files/logo.gif);
	background-repeat: no-repeat;
}