Is it possible to add an extra dropdown with some custom items, for instance. I want to allow the user to insert some placeholders (ie. %%firstname%%) so they can create a template for an email, and therefore add personalisation.
I have managed to duplicate a lot of stuff to the point that I can get the toolbar there but it wont insert anything.
Is this possible?
John Watson
I have managed to duplicate a lot of stuff to the point that I can get the toolbar there but it wont insert anything.
Is this possible?
John Watson
RE: Add extra toolbars
TBI.prototype.Placeholders = new TBCombo( "Placeholders", "insPlaceholder(this)", "Insert Placeholder", ";First Name;LastName;E-Mail", ";%%firstname%%;%%lastname%%;%%email%%") ;
This line creates a new toolbar item called "Placeholders". When the final user selects an option in the dropdown list, the "insPlaceholder" function is called. So you have to write this function to handle the editor action. You could add it at the fck_actions.js file. The function should be something like this:
function insPlaceholder(combo)
{
if (combo.value == null || combo.value == "")
insertHtml(combo.value) ;
}
This should help you. Thanks for your interest. Best regards,
FredCK
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
RE: Add extra toolbars
FredCK
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
RE: Add extra toolbars
The only thing i can see is that the function:
TBI.prototype.Placeholders = new TBCombo( "Placeholders", "insPlaceholder(this)", "Insert Placeholder", ";First Name;LastName;E-Mail", ";%%firstname%%;%%lastname%%;%%email%%") ;
differs from others because it is missing a final parameter, for instance the function below:
TBI.prototype.FontStyle= new TBCombo( "FontStyle", "doStyle(this)", "Style", config.StyleNames, config.StyleValues, 'CheckStyle("cmbFontStyle")') ;
Note the last parameter has a function name: 'CheckStyle("cmbFontStyle")'
What should go here?
regards
John
My apologies...
John
RE: Add extra toolbars
Yippee
The problem was that my function:
function insPlaceholder(combo)
{
if (combo.value != null || combo.value != "")
insertHtml(combo.value) ;
}
Was in correct the above is good, in case anyone else is using this as a reference,
John Watson