nope_four
nope_four

Reputation: 492

CK Editor, placeholder plugin & dynamic items

For my needs, I need different set of placeholder items for different CKEditor instances. I have changed the dialogs\placeholder.js to select box. I am trying to add placeholder items via few different ways, but I am having no luck. My dream would be to add the the placeholders via the on page CKEditor call - CKEDITOR.replace ...

**dialogs\placeholder.js**

elements: [
// Dialog window UI elements.
{
id: 'name',
type: 'select',
style: 'width: 100%;',
label: lang.name,
items:[
    ['CompanyName'],
    ['Address'],
    ['City'],
    ['State'],
    ['Zip']
],

Thanks in advance.

http://ckeditor.com/addon/placeholder

Upvotes: 2

Views: 694

Answers (1)

nope_four
nope_four

Reputation: 492

I have figured it out. Edit the dialog page and write bad (improper) code

This is what worked for me. (ColdFusion)

Change where the dialog points to (in my case from .JS to .CFM):

CKEDITOR.dialog.add( 'placeholder', this.path + 'dialogs/placeholder.CFM' );

Open the /placeholder/dialogs/placeholder.js and save as placeholder.cfm

On the top of cfm page:

<cfquery datasource="data" name="query">
SELECT DISTINCT State FROM Addresses ORDER BY State</cfquery>

In the middle:

items:[
<cfoutput query="query">
        ['#State#'],
</cfoutput>
],

Do not add script tags or such, don't add anything else. That's it.

Upvotes: 1

Related Questions