CGSmartimage & Background-image

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
musicscore
Power Poster
Power Poster
Posts: 444
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

CGSmartimage & Background-image

Post by musicscore »

I want to define a (variable) background image in a div.
I use this code :

Code: Select all

<div class='news-image' style="background-color: transparent;background: url([[CGSmartImage src="\uploads\images\{$field->displayvalue}"  filter_croptofit="360,190,c"]]);"></div>
CGSmartimage should croptofit the background image

This is not working. The image is not shown at all.

Please help. What is wrong here.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGSmartimage & Background-image

Post by Rolf »

The use of [[ and ]] is only for in CMSMS stylesheets.
Use here the regular { and }.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
musicscore
Power Poster
Power Poster
Posts: 444
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: CGSmartimage & Background-image

Post by musicscore »

Rolf,

I tryed that but then the <img> tag is added to the filename and the line is converted to

Code: Select all

<div class="news-image" style="background-image: url("<img ....
and this is not working.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGSmartimage & Background-image

Post by Rolf »

Add notag=1 parameter (or something)
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
musicscore
Power Poster
Power Poster
Posts: 444
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: CGSmartimage & Background-image

Post by musicscore »

Rolf,

Thanks. You saved my day (and my idee).
Its working. (look at http://at2.dev-infowebs.nl

The images on top of the news-items are zooming on hover.

Thanks again Rolf
Locked

Return to “Layout and Design (CSS & HTML)”