Hej,
jag försöker skapa en ny knapp i editorn, som bara ska visas på en sida. Hur villkorar jag visningen av knappen, eller kan jag skapa den inifrån just den sida där den ska visas?
Tack,
nybörjaren
If you want to display a button when creating/editing a page, this is probably best accomplished by creating the button as a userdefined property.
This way you are sure not to mess up anything, which may happen if you change the code directly in the files in /edit folder.
What exactly is the button supposed to do?
It´s supposed to mark up a selected part in a text in a certain way.
The button appears in the editor just fine from a javascript-file ("stolen" from codeexampels on this page), but it is shown in all editors, not only in that specific page I´m trying to reach.
See the IConfigurableTool interface in the SDK, and the Available method. That should do the trick.
Note, this runs on the server, so you can get the containing (EPiServer) page by using the Page property on the tool (as it inherits from Control.) Cast it to a PageBase, and you can check the page type and all the other properties on the page.