Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tajamal 87 posts 175 karma points
    May 10, 2021 @ 11:36
    Tajamal
    0

    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.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 10, 2021 @ 14:30
    Huw Reddick
    0

    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?

  • Tajamal 87 posts 175 karma points
    May 10, 2021 @ 14:48
    Tajamal
    0

    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.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 10, 2021 @ 19:36
    Huw Reddick
    0

    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.

  • Tajamal 87 posts 175 karma points
    May 10, 2021 @ 20:09
    Tajamal
    0

    I found out, maybe using custumconfig add something to manipulate src data, not sure if that’s a lost case.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 10, 2021 @ 21:53
    Huw Reddick
    0

    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?

  • Tajamal 87 posts 175 karma points
    May 10, 2021 @ 21:57
    Tajamal
    0

    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.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 10, 2021 @ 22:14
    Huw Reddick
    0

    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 :)

  • Tajamal 87 posts 175 karma points
    May 21, 2021 @ 16:47
    Tajamal
    0

    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.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 21, 2021 @ 18:03
    Huw Reddick
    0

    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.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    May 24, 2021 @ 10:20
    Huw Reddick
    0

    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

  • Tajamal 87 posts 175 karma points
    May 26, 2021 @ 14:37
    Tajamal
    0

    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 ?

Please Sign in or register to post replies

Write your reply to:

Draft