I can't see anything in the tinymce config that would not permit it, when you attempt it, what happens? does it strip the query parameters out ? or is it maybe encoding them etc?
What I want to do is, when someone adds a iframe with a src attribute , I want to add a default parameter to the url and I have no idea how to configure that.
Parsing the rte data would be fairly easy as it is basically just html, but it depends whether it is being rendered directly into a template using content properties or using one of the grid rendering functions, what does you page template look like?
You could maybe write a custom property editor to do it yes might not be any easier or maybe some sort of custom tinymce plugin maybe, lots of options just not sure which would be the easiest :)
That would really depend how you are referring the content. If it is an eye in a grid it won't be easy, if it is an eye that is a property on your document then it would be easy to do it with regex.
If you take a look in Views\Partials\Grid\Editors you will see a file called Rte.cshtml This is what renders the content of the RTE, you should be able to either parse the content here or perhaps write a method to extend htmllink parsers to accomplish what you want
tinyMce adding query parameter to src
Hi , I am using an iframe in RTE and i want to add a default query parameter to the src, is that possible ?
Alternative solution could be adding the parameter when i render my code!
But it would be nicer, if it's possible in RTE.
I can't see anything in the tinymce config that would not permit it, when you attempt it, what happens? does it strip the query parameters out ? or is it maybe encoding them etc?
I have no problem adding a iframe.
What I want to do is, when someone adds a iframe with a src attribute , I want to add a default parameter to the url and I have no idea how to configure that.
Ah, well that is an entirely different question :)
You will need to parse the rte content, either in your view or maybe I rendering controller or something.
I found out, maybe using custumconfig add something to manipulate src data, not sure if that’s a lost case.
Parsing the rte data would be fairly easy as it is basically just html, but it depends whether it is being rendered directly into a template using content properties or using one of the grid rendering functions, what does you page template look like?
It’s both , data is rendered in a template and as a grid element. I thought it would be nicer to do it in backoffice.
You could maybe write a custom property editor to do it yes might not be any easier or maybe some sort of custom tinymce plugin maybe, lots of options just not sure which would be the easiest :)
If only I knew where to start 🤔
It would be nice, if somehow I could manage to do that in the backoffice, but still don't know how to.
The easiest would be when rendering the content.
That would really depend how you are referring the content. If it is an eye in a grid it won't be easy, if it is an eye that is a property on your document then it would be easy to do it with regex.
Hi Tajamal,
If you take a look in Views\Partials\Grid\Editors you will see a file called Rte.cshtml This is what renders the content of the RTE, you should be able to either parse the content here or perhaps write a method to extend htmllink parsers to accomplish what you want
Hi Huw Reddick,
I found an example to add a custom template.
How do it make a editable template? User should be able to change a src of an image or link, how do i achieve that ?
is working on a reply...