Hi,
have a look:
Script into <head> area
- Write a CP "image <div>" in a hidden area.
Template for CP "image <div>"
Code: Select all
<!--IMAGE_SETTINGS_START//-->
; this is formatted like WIN.INI
; please: do not use comments for value lines
; settings will overwrite CP settings
;width = 100
;height = 100
col = 1
zoom = 1
;crop = 0
space = 0
lightbox = 1
nocaption = 1
; 0 = no center, 1 = horizontal/vertical, 2 = horizontal, 3 = vertical
;center_image = 0
<!--IMAGE_SETTINGS_END//-->
<!--IMAGES_ENTRY_START//-->
[PHP]
/* Hm I want to overwrite some default CSS */
$GLOBALS['block']['custom_htmlhead']['mycss'] = ' <style type="text/css">' . LF . ' <!--' . LF;
$GLOBALS['block']['custom_htmlhead']['mycss'] .= ' body { ' . LF;
// $GLOBALS['block']['custom_htmlhead']['mycss'] .= ' background: #F9E931 url({IMAGE_REL}) no-repeat left top !important;' . LF;
$GLOBALS['block']['custom_htmlhead']['mycss'] .= ' background: #F9E931 url(filearchive/{IMAGE_HASH}.jpg) no-repeat left top !important;' . LF;
$GLOBALS['block']['custom_htmlhead']['mycss'] .= ' }';
$GLOBALS['block']['custom_htmlhead']['mycss'] .= LF . ' //-->' . LF . ' </style>';
[/PHP]
<!--
Thumbnail image: {THUMB_NAME}
relative: {THUMB_REL}
absolute: {THUMB_ABS}
height/width: {THUMB_HEIGHT}px/{THUMB_WIDTH}px
height/width max: {THUMB_HEIGHT_MAX}px/{THUMB_WIDTH_MAX}px
columns: {THUMB_COLUMNS}
image ID: {IMAGE_ID}
image Hash: {IMAGE_HASH}
If you are not sure wrap zoomed image:
[ZOOM]
Zoomed (big) image: {IMAGE_NAME}
relative: {IMAGE_REL}
absolute: {IMAGE_ABS}
height/width: {IMAGE_HEIGHT}px/{IMAGE_WIDTH}px
[/ZOOM]
//-->
<!--IMAGES_ENTRY_END//-->
Delete what you do not need.
Please have a closer look to this two lines:
Code: Select all
// $GLOBALS['block']['custom_htmlhead']['mycss'] .= ' background: #F9E931 url({IMAGE_REL}) no-repeat left top !important;' . LF;
$GLOBALS['block']['custom_htmlhead']['mycss'] .= ' background: #F9E931 url(filearchive/{IMAGE_HASH}.jpg) no-repeat left top !important;' . LF;
First (disabled) line uses an image with the max. x/y from config
Code: Select all
$phpwcms['img_prev_width'] = XXX
$phpwcms['img_prev_height'] = YYY
The second line uses the original uploaded image from filearchive. But you must disable the .htaccess in this folder and the .ext is fixed in script.
If more than one image is specified in the CP, the last one is winning the race. This can be beneficial, so multiple images are in the CP and the desired is simply pushed down.
Insert this CP with {SHOW_CONTENT:CP,XX} into yout layout.
The same im wiki:
CSS background image controlled by phpWcms
Knut