We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28341
    • 43 Posts
    Nope, but TVs. Might have something to do with it.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Ditto has phx built in, no need to install the plugin. If you’re using Richtext type TVs, then the force_root_block setting for the TinyMCE used for these will add <p>...</p> tags. You may also be getting them if your TVs have an output widget assigned to do that.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28341
        • 43 Posts
        I see. I removed the installed plug-in and now there’s no longer an extra <p></p>. Isn’t that a bit odd? smiley
        Thanks to both you guys.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I wouldn’t be surprised at anything the phx plugin did. I never use it. But that’s only my personal preference.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 24665
            • 14 Posts
            Quote from: microcipcip at Jun 17, 2010, 05:23 AM

            1) Download and install PHx
            2) Go to Elements > Manage Elements > Snippets > New Snippet, and add the following:
            Snippet name: phx:character_limit
            Snippet code (php):
            <?php
            if (strlen($output) > $options) {
                  $output_cutted = substr($output, 0, $options);
                  $last_space = strrpos($output_cutted, " ");
                  $output = substr($output_cutted, 0, $last_space) . "";
                  }
                  return $output;
            ?>

            3) Save and Close the Snippet
            4) Go to your Ditto template and add something like this:
            <p>[+introtext:character_limit=`360`+]</p> 


            As you can see the original Placeholder was [+introtext+], so I’ve just added this code ":character_limit=`360`" inside.


            I need this solution and tried what you said. When i use "phx:character_limit" as snippet name, it says "Snippet name is invalid". What am I doing wrong? :-S

            I get this error on my homepage:

            Fatal error: Class ’PHxParser’ not found in /home/ivxtopmb/domains/blabla.bla/public_html/modx/core/cache/elements/modplugin/3.include.cache.php on line 24
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That suggestion would not apply to Revolution. With Revo placeholder tags look like [[+placeholder]]. I know Revo has phx functionality built-in, but I don’t know how it works.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 24665
                • 14 Posts
                Interesting. So I don’t have to use PHx at all? Does anyone know how to use the PHx library in Revolution then? smiley