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

    After upgrading to 1.0.10 I have this problem with values set in menutitle field. I am using
    to force dividing two words into two lines. It worked before and now it escapes the code and does not interpret it as HTML.
    How can I force MODx to make a new line in this field?

    Thx,
    Greg
      • 38009
      • 7 Posts
      I checked in the database, the value is stored properly (with
      inside).
      I am using default Wayfinder tpl:
      [!Wayfinder? &startId=`0` &level=`1`!]

      I am searching further...
      • Can you use css to limit the width of the <li>?
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 38009
          • 7 Posts
          OK, I found it. Changes in Wayfinder:

          Previous code:
          $phArray = array($useSub,$useClass,$classNames,$resource['link'],$resource['title'],$resource['linktext'],$useId,$resource['alias'],$resource['link_attributes'],$resource['id'],$resource['introtext'],$resource['description'],$numChildren);
          


          New version:
          $phArray = array($useSub,$useClass,$classNames,$resource['link'],htmlentities($resource['title'], ENT_COMPAT, $charset),htmlentities($resource['linktext'], ENT_COMPAT, $charset),$useId,$resource['alias'],$resource['link_attributes'],$resource['id'],htmlentities($resource['introtext'], ENT_COMPAT, $charset),htmlentities($resource['description'], ENT_COMPAT, $charset),$numChildren);
          
            • 38009
            • 7 Posts
            I wonder why they did that? Security reasons? Is there a way to be able to put HTML in this field? Now I made a small custom modifier for PHx.

            Greg
            • This was changed, because the default template uses the title attribute and in the title attribute quotes, tag delimiters and ampersands are not allowed (http://tracker.modx.com/issues/3730)

              It should better be changed to htmlspecialchars to not encode all chars. And encoding should be set to disabled by wayfinder parameter with default to enabled (http://tracker.modx.com/issues/9875).

              To solve the current problem on your installation you could use the following PHx construct and modifier (Wayfinder is not PHx capable and the PHx plugin has to be installed), if you don't want to patch the Wayfinder code:
              [*phx:input=`[+wf.title+]`:entity_decode*]


              entity_decode.phx.php
              return html_entity_decode($output);
                • 38009
                • 7 Posts
                Quote from: Jako at Apr 25, 2013, 10:21 AM

                entity_decode.phx.php
                return html_entity_decode($output);

                Generally that's what I did smiley
                Thx
                Greg