We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2901
    • 277 Posts
    Hi All

    I have a strange problem in Revo 1.0.0. When I use & in the title and longtitle, they are not being replace by &.

    Anyone a idea why this could be? I think under the aspect of user friendliness this should be automatic.
    Thanks in advance
      • 26931
      • 2,314 Posts
      anonymized-26931 Reply #2, 17 years ago
      Hi bbeer,

      I have a strange problem in Revo 1.0.0.
      i guess you mean Evolution

      in that case one solution would be:
      http://modxrules.com/articles/xhtml-valid-pagetitlelongtitle-and

      but then you’ll still have unescaped "&"s in wayfinder...there’s a plugin to replace all unescaped "&"s on your site...i’ll look for it and post it here...

      Plugin:
      //<?php
      // Begin plugin code
      $e = &$modx->event;
      
      $id = $modx->event->params['id'];
      
      if ($e->name == 'OnWebPagePrerender') {
      	$o = &$modx->documentOutput; // get a reference of the output
      	// Replace all ^text inside hats^ to <sup> tags, useful for more friendly Wayfinder replacements
      	$o = preg_replace('%\^([()a-zA-Z0-9 ]*)\^%i', "<sup>$1</sup>",$o);
      	// Replace orphan & with &
      	$o = preg_replace('%&(?![a-zA-Z0-9#]{1,6})%i', "&",$o);
      	// Replace ].]> with ]]>, useful for CDATA tags inside PHx calls: http://modxcms.com/forums/index.php?topic=31435.0
      	$o = str_replace('/* ].]> */', '/* ]]> */',$o);
      }
      
      $e->output($o);
      return '';

      System Event [X] OnWebPagePrerender
        • 2901
        • 277 Posts
        Hey sharkbait

        yeah Evolution sorry. Would really appreciate the plugin solution.

        Thank you!
          • 26931
          • 2,314 Posts
          anonymized-26931 Reply #4, 17 years ago
          Would really appreciate the plugin solution.
          plugin added to the post above
            • 2901
            • 277 Posts
            thanks a lot, thats great.
              • 22668
              • 718 Posts
              Would be nice to see this in the evo distro.
                • 2901
                • 277 Posts
                Paprikas

                this is for Evo!
                  • 25663 MODX Staff
                  • 12,272 Posts
                  He meant as a default part of the distribution I think.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 2901
                    • 277 Posts
                    that would indeed be great
                      • 20349 ☆ A M B ☆
                      • 453 Posts
                      Does this plugin work with Summary (introtext) too?
                        BASE - Web Design Studio
                        MODX Ambassador

                        Website