PlugIn i Editorn

Jag försöker skapa en icon till editorn där användaren kan göra en linje
Iconen syns inte och jag får "fel" vid kompilering att IconOver och IconOff är gammalmodigt, att man ska använda Iconbase o IconType ist, är det därför det inte fungerar? Sen försöker jag retunerna en sträng med
men det verkar inte räcka? Tips emottages gärna.
Nov 12, 2004 13:41
Do you have the EPiServer book? Chapter 13, page 303 will help you... If you dont - paste some code so we can have a look at it /John
Nov 12, 2004 14:08
IconOff/IconOver still works, but we recommend using IconBase instead. You can have a look at this plugin sample. It is technically similar to your plugin:
Nov 12, 2004 14:35
I tried this sample in 4.30 and I got warnings about iconoff/iconover . It says they will be removed in the future - in which version will they be removed? There is no sign of IconBase in this example - When was IconBase introduced? The EPiServer book makes no reference to IconBase either but maybe in the next edition I guess... /John
Nov 12, 2004 15:08
I have used that example but can´t get the icons right Class-file: ClientScriptKey = "EditorPlugInLine.js"; ClientScriptBlock = editor.GetScriptTag("EditorPlugInLine.js"); IconOver = "dotline.gif"; IconOff = "dotted_grey_line.gif"; ClientSideOnClick = ("GetLine('{0}')"); JS-file: var line = "
"; return line.htmlText;
Nov 12, 2004 15:23
Are they in the right folder? /util/images/Editor Do you get the image missing icon? rigth click on it, choose properties and you will see where it is looking for the images. I had put mine in Images folder by mistake but moved them to the Editor folder and now they work.
Nov 12, 2004 15:30
The IconBase/IconType properties were introduced in 4.30, to make it easy to define a set of ikons with a one-liner. It made sense to simplify the icon definition part, since the editor plugin-icon has a strict _. format, for example n_off.gif, n_over.gif etc. So instead of saying IconOff = "n_off.gif"; IconOver = "n_over.gif"; . . you just say IconBase = "n"; And the editor will do the rest for you. As long as the filetype is the default (gif), you do not even have to bother about IconType. The sample editor plugin I referred to is now updated, so it uses IconBase. Unfortunately the book uses the old properties, we will fix that in the next revision.
Nov 12, 2004 16:02
Det fungerar om jag använder redan befintliga ikoner i util/images/editorn men inte om jag lägger dit egna. Iconbase fungerar. Men jag får fortfarande inte in något
i editorn. Några förslag?
Nov 17, 2004 8:54
I modified the example to get it to work instead of subscript.. a minor adjustment should get you what you need... in js file located at: util/javascript/editor function GetLine(id) { var currentTextRange = getEditor(id).document.selection.createRange(); var currentText = currentTextRange.htmlText; var newText = currentText + "
"; currentTextRange.pasteHTML(newText); }
in the cs file: ClientSideOnClick = String.Format("GetLine('{0}')", editor.ClientID);
Nov 17, 2004 11:10
ps. the link to the example is now broken since the episerver site update!
Nov 17, 2004 11:11
Its now here: id=2648&file=SubscriptTool.js /John
Nov 17, 2004 11:12
IconBase = "hr"; IconType = ".gif"; /util/images/Editor/hr_disabled.gif /util/images/Editor/hr_off.gif /util/images/Editor/hr_over.gif /util/images/Editor/hr_selected.gif Detta funkar fint.
Nov 18, 2004 10:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.