We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello, I'm creating links with tinymce.

    a normal link created using tinymce, for example: <a href="[[~161]]">link</a>

    on the web site code looks like: <a href="%5B%5B~161%5D%5D">linl</a>

    but if I create the same one inside a chunk it works well.

    can anyone help me?

    thank you!

    This question has been answered by donshakespeare. See the first response.

      --
      ysanmiguel.com
      • 42562
      • 1,145 Posts
      No one uses tinymce-4.3.4-pl Extra anymore, it is dead!
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 33238
        • 388 Posts
        Quote from: donshakespeare at Mar 09, 2017, 02:12 PM
        No one uses tinymce-4.3.4-pl Extra anymore, it is dead!

        https://modx.com/extras/package/tinymce
        Download: 321.101
        but looks like I'm the only one with the problem tongue

        so, what do you recommend: TinymceWrapper 2.3.2-pl?

        I need something easy to preset custom classes and don't delete the data- attributes.
        ahh and obviously, create the right link syntax smiley [ed. note: Ysanmiguel last edited this post 7 years, 1 month ago.]
          --
          ysanmiguel.com
          • 42562
          • 1,145 Posts
          It has 321,105,984 billion downloads, because that particular version came out when dinosaurs used to deliver mail, and when people still scratched their backs with bones.

          And also that number is so huge, because people still mistakenly click on the download button thinking it is TinyMCE.
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 33238
            • 388 Posts
            Quote from: donshakespeare at Mar 09, 2017, 03:31 PM
            It has 321,105,984 billion downloads, because that particular version came out when dinosaurs used to deliver mail, and when people still scratched their backs with bones.

            And also that number is so huge, because people still mistakenly click on the download button thinking it is TinyMCE.

            hahaha good, but anyway I need a fix or something else, please enlighten me.

            thank you!
              --
              ysanmiguel.com
              • 42562
              • 1,145 Posts
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 33238
                • 388 Posts
                Mate (donshakespeare), this is quite interesting, do you remember this?
                [[*content:cuteLazyImages]]


                You help me with this long time ago:
                <?php
                $content = $input;
                $dom = new DOMDocument();
                $dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')); //added encoding
                $imgs = $dom->getElementsByTagName('img');
                foreach ( $imgs as $img) {
                   $src = $img->getAttribute('src');
                   $img->setAttribute('data-original', $src);
                   $img->setAttribute('src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII');
                }
                return $dom->saveHTML();


                well that is why the links are not working!
                can you please help me?

                thank you! smiley
                  --
                  ysanmiguel.com
                • discuss.answer
                  • 42562
                  • 1,145 Posts
                  You need to parse MODX tags first:
                  <?php
                  $content = $input;
                  $content = $modx->newObject('modChunk')->process(null, $content ); //parse those Link tags
                  $dom = new DOMDocument();
                  //etc etc
                    TinymceWrapper: Complete back/frontend content solution.
                    Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                    5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • 33238
                    • 388 Posts
                    Quote from: donshakespeare at Mar 13, 2017, 07:04 PM
                    You need to parse MODX tags first:
                    <!--?php
                    $content = $input;
                    $content = $modx--->newObject('modChunk')->process(null, $content ); //parse those Link tags
                    $dom = new DOMDocument();
                    //etc etc

                    Mr donshakespeare, you are one of the big ones, thank you very much mate!
                    now everything works, I'll still using tinymce-4.3.4-pl hahaha for now and until the next problem tongue

                    Thank you very much!!!!
                      --
                      ysanmiguel.com
                      • 42562
                      • 1,145 Posts
                      Glad that fixed it.
                      Cheers.
                        TinymceWrapper: Complete back/frontend content solution.
                        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.