button in editor

Topics: General, Visual editor
May 19, 2011 at 5:19 PM

I have seen the guide
http://docs.composite.net/C1/Console/CustomizingVisualEditor/Buttons.aspx

But what if I want to have a button there inserts a lot of HTML. I would like to use it as selecting an template.

Click here and have "template1"

How can I do that?

Coordinator
May 19, 2011 at 11:30 PM

Currently it is only styling (setting class) and single elements that you can create buttons for, sorry.

We are working on an idea where you can create markup snippets which the user can easily insert - this could be a pre-built html table or a function call editors would use often.

Right now, perhaps you can obtain your desired goal with a C1 Function? Instead of giving the editor a blob of html where they customize it by editing boiler plate text, you give them a C1 Function where they provide the custom texts/content as parameters. Are you familiar with XSLT functions or into C#? C1 Functions can be fairly ideal in situations like these.

May 24, 2011 at 5:39 PM

Yes thats an option.

But not so userfriendly that they have to put in a Function, and then give it paramters, for inserting a prefilled table or something like that.

So in this case it is not an option

Coordinator
May 25, 2011 at 10:59 AM

Okay, then you only option is to implement it by making changes to the 'core javascript code' - you should be able to find the relevant elements in ~\Composite\content\misc\editors\visualeditor

We will prioritize the 'markup snippets' idea so this become much easier to do.