gproulx
Posts: 68
|
| Posted: 09/29/2008, 8:57 AM |
|
My problem is that i have multiple articles and for each article, i want to display a different image in background, with the text over it. It is possible?
In my db i have article_id,article_title, article_content and article_image. i want 'article_image' in background of 'article_content'.
thanks
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/30/2008, 7:38 AM |
|
Hi
This should be easy to do.
If you want the image to be for the whole page: Like This:
In the html change your body tag to look like this
<body background="{BGImage}">
Then in the before show event (After you get the image url from the database)
global $Tpl;
$Tpl->setvar("BGImage",ImageURLStringFromDB);
This will change the entire page background image.
You can do the same thing of you want it for a table only:
HTML:
<table background="{BGImage}">
And the same CCS code
You could also apply this to cells or rows by using inline styles something like this
<td style="background-image:url('{BGImage}')">
(Note same would be true with th and tr tags)
And the same CCS code.
BTW: The image URL does not have to be a full http:// type url if the image is located on your server. It would only have to comtain the path to the image relative to where the script is running.
Have fun.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
DonP
|
| Posted: 10/02/2008, 11:30 AM |
|
I created a simple CCS script that is able to load background (or any)
image and it can even load an image randomly. It is called with a
standard image tag so it works even is a style sheet although for your
needs, it would probably have to be done dynamically for each article in
order to know which background to use.
Don (DonP)
gproulx wrote:
> My problem is that i have multiple articles and for each article, i want to
> display a different image in background, with the text over it. It is possible?
>
> In my db i have article_id,article_title, article_content and article_image. i
> want 'article_image' in background of 'article_content'.
>
> thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
|