We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37914
    • 89 Posts
    I use MODx as CMS for a Flash website trough XML documents.
    Flash can't handle <strong> tags but needs <b> tags instead.
    I need to use TimyMCE and can't make it convert <strong> tags to <b> tags.
    Can someone tell me how to make an output filter convert <strong> to <b> tags?
    Many thanks in advance!
      • 3749
      • 24,544 Posts
      You'd need the modifier for every field on the page or the template that might contain tags. I think you'd be better off with a plugin attached to OnWebPagePrerender, something like this:


      <?php
      /* Code for strongToB Plugin */
      $output =& $modx->resource->_output;
      $replacement = array('<b>','</b>');
      $words = array('<strong>', '</strong>');
      $output = str_replace($words, $replacement, $output);
      


      If you're sure all the strong tags are in the Resource content field, you could use a plugin attached to OnBeforeDocFormSave, then the tags would be converted each time the doc is saved and page loads would be faster:

      <?php
      /* Code for strongToB Plugin */
      $pageContent = $modx->resource->getContent();
      $replacement = array('<b>','</b>');
      $words = array('<strong>', '</strong>');
      $pageContent = str_replace($words, $replacement, $pageContent);
      $modx->resource->setContent($pageContent);
      



      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODx info for everyone: http://bobsguides.com/MODx.html [ed. note: BobRay last edited this post 12 years, 3 months ago.]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 37914
        • 89 Posts
        Thanx BobRay, i'll try that!

        MODX Revolution 2.2.0-pl2 (traditional)
          • 37914
          • 89 Posts
          It works great!
          Thank you very much Hey BobRay!!
            • 3749
            • 24,544 Posts
            Glad it worked. smiley


            ---------------------------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
            MODx info for everyone: http://bobsguides.com/modx.html
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting