Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Image as background ?

Using

<body text="#000000" background={$.extra1$}>

a user should be able to select an article background image simply by inserting it into the article's extra1 field. Does not work: CD is surrounding the image link with lots of HTML stuff...even when inserting as "raw". Any ideas ?

Patrick

Patrick Thomas
Wednesday, April 24, 2002

Your code seems to work well if the extra1 field contains the "magic name" of the image (looks like PTMFOG0000000011.gif) that you get by right click on the concerned image on the main tree. no quotes seem necessary

Vincent Bénard
Wednesday, April 24, 2002

If you drop an image in the extra1 field, then the HTML of the field will be <img src="image.jpg"> because the extra1 field is an image.

In order to get it to work the way you want, you should type the IMAGE FILE NAME into the extra1 field, or just the magic name as Vincent suggested, NOT drop the entire image into the field.

Customer Service
Wednesday, April 24, 2002

question to customer-service:

will it work if you precise only the image file name without precising the relative path from the considered page to the images folder ? haven't you to put the entire relative path in the extra1 field  (impossible for nearly every normal user) ?

(and that's why magic names are so great..)

Vincent Bénard
Wednesday, April 24, 2002

Thanks. We wanted to avoid having the user to fiddle with magic names (another item to explain)...but thats the way it will have to go.

o Raw
o Link only :-)

Patrick

Patrick Thomas
Wednesday, April 24, 2002

Recap this for me please, I'm getting confused.  What exactly goes in the Extra field and in the template?

tk
Wednesday, April 24, 2002

Goal: user selects a picture to become the pages background image. Every resulting HTML page (aka article) should this way be able to have its very own background image.

Ideal: User inserts picture (thats visual!) into the extra1 field (of an article) and template has a <body background={$.extra1$}> to specify the background image. Yes, its not entirely logical to do it this way as CD would and should treat the picture in extra1 as what it is: an image => <img src=xyz>. Well, one thought CD to recognize the reference to be a tag parameter and skipping the img-src-stuff accordingly. It does not, no big deal, no harm done.

Solution: Have the user copy the magic name of a picture into the extra1 field. Template code stays the same.

Patrick

Patrick Thomas
Wednesday, April 24, 2002

Where do you put the {$.extra1$} variable?  In the ARTICLE, the article's TEMPLATE, the INDEX file?  All three?  Only two?  (I just tried several unsuccessful combinations.)

Thanks.

Gilles
Wednesday, April 24, 2002

put the code :
<body text="#000000" background={$.extra1$}>
in the template

then , in the article using this template, paste the "magic name" of the image in the extra1 field (with no other sign, no "", ...)

and it works properly.

Vincent Benard
Wednesday, April 24, 2002

Works like a charm!  Thanks!

Gilles
Wednesday, April 24, 2002

Hi, I am trying to ad a "background" image into the a template so that it is allways there when I use that template.  I can't see anywhere in CD where I can ad as Background, but I then try to edit the Template in Dreamweaver and ad the background image and save it.
But when I create a article of that template, it is still not there???

Any help would be great.

Cheers John

john Grothe
Monday, April 29, 2002

You probably need to use the magic name of the background image.

tk
Monday, April 29, 2002

*  Recent Topics

*  Fog Creek Home