PD editor insert-image
The button 'Add': This button will actually add the html image tag with the source path to the editor. This button holds the OnClick event called 'createImage'. <input type="button" name="addimage" value="Add" onClick="createImage();"> The function is shown below and needs be inserted into the existing HTML editor script that is below the textarea brackets ( <textarea name="EditorValue" style="display: none;"></textarea> ):
A good place to insert it, would be below the function 'makeUrl'. What does this do ? It takes the value of the hiddenfield (path) and the value of the dynamic menu (filename) and creates a image tag. The new browser window: This is needed to pre-view the selected image in the menu. We load this window when the HTML editor page loads.
Place this javascript in the head of your HTML editor page. Create a new page for the pre-view browser window and just add the following (don't forget the name of the tag !): <html> We need the name of tag for the pre-view function. Notice that the source (http://www.domein.com/Images/startup.jpg) consists of our earlier defined hidden field 'prefix' and the menu 'imagebank'
|
Marcellino Bommezijn
Marcellino Bommezijn is one of the managers at dmxzone.com. He is a contributor on the tutorials section.
Owner of Senzes Media (http://www.activecontent.nl) which provides professional services and web applications for mid-sized companies.
ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.
Comments
Thanks
Align Image?
I've used your method to add images...Thanks for the help. How would I go about enhancing this to be able to insert the align="left" or "right" tag? The same goes for adding a border around the image.
RE: Align Image?
thats a big question!
do you have a answer now?
Style sheets?
You must me logged in to write a comment.