Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > editable background image View modes: 
User avatar
Member
Member
gary.chan-e-crusade - 4/20/2009 4:00:25 AM
   
editable background image
Hi,

How can i create a webpart to build editable background image for a particular div ?

Thanks

User avatar
Member
Member
gary.chan-e-crusade - 4/27/2009 10:28:54 PM
   
RE:editable background image
Does anyone have suggestions to make it?

Actually i would like to build a webpart to let user add or edit background image of a particular DIV , so as to friendly change the background image easily without coding.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 4/28/2009 4:45:46 AM
   
RE:editable background image
Hi Gary,

you could use for example the standard editable region and style it with the help of CSS styles so that the image would be in the same location as a text (or other content). You could use the z-index CSS property – please see here: http://www.w3schools.com/Css/pr_pos_z-index.asp

Best regards,
Helena Grulichova


User avatar
Member
Member
gary.chan-e-crusade - 4/28/2009 5:02:49 AM
   
RE:editable background image
Thanks for the suggestion,

However, I would like to provide friendly environment for user to edit background image. Would you mind explain it how to build webpart that can change the background image easily?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 4/29/2009 10:26:40 AM
   
RE:editable background image
Hello,

You could try to make custom user control which will use javascript. Using this javascript code you will allow users to change background by changing CSS stylesheet.

Best regards
Ondrej Vasil

User avatar
Member
Member
gary.chan-e-crusade - 4/29/2009 9:59:44 PM
   
RE:editable background image
Thanks kentico_ondrejv,

However, I would like to let user to freely add image as background instead of , predefined CSS stylesheet.

Assume that , user can add any image in this webpart as DIV 's background.


User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/19/2009 9:12:24 AM
   
RE:editable background image
Hello Gary,

You could try this approach, too:

You would not use the editable image web part but document of CMS.File type where you could upload (and change) the image.

Then you could use the JavaScript and with the help of document.getElementById function you would find your div and set its background image with URL of the document.

More information about mentioned JavaScipt functions:
https://developer.mozilla.org/En/Document.getElementById
http://www.comptechdoc.org/independent/web/cgi/javamanual/javastyle.html

Best regards,
Helena Grulichova


User avatar
Member
Member
gary.chan-e-crusade - 5/25/2009 4:56:52 AM
   
RE:editable background image
Thanks for suggestion