P
P
Pazzetif2018-07-19 11:41:43
JavaScript
Pazzetif, 2018-07-19 11:41:43

How to insert html code into ckeditor plugin?

Greetings. There is a plugin:
https://codepen.io/anon/pen/ejdbem
This is a regular dropdown box.
At the moment, when choosing any name from the list, its id is put in the editor.
For example, how can I insert, for example, html code instead of id.
Here is one for example.

<a href="" data-html="true" data-trigger="hover" data-toggle="popover" data-content="<div class='hero-footnote'>
                        <img src='images/hero/sniper.svg' alt='sniper'>
                        <div class='hero-footnote__desc'>
                            <h3>Sniper</h3>
                            <p>Дальний бой</p>
                            <span>Carry — Nuker — Mider</span>
                        </div>
                    </div>"><img src="images/hero/sniper.svg" style="width: 26px; height: 15px; margin-top: 0; margin-right: 4px" alt="">Sniper</a>

And another question, how can you interact with the database from the ckeditor plugin? Execute php script in it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-07-19
@webinar

Execute php script in it.

no way, this is js, it is executed in the user's browser, where does php come from?
You can send ajax to the server, execute some php there and return the result
again 25. You can't do that
At the moment, when choosing any name from the list, its id is put in the editor.
For example, how can I insert, for example, html code instead of id.

where is the list? What is the html code? Just any html instead of any id?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question