rash Posted March 12, 2021 Share Posted March 12, 2021 Hi all, I’m using the Textile module for all of my own and most of my client’s sites and that works just fine. For the first time I have the need to allow a bit basic formatting in a user input textarea delivered by the PW comment system and I don’t know how to "textilize" the comment text. The line in my comments output: $text = $comment->getFormatted('text'); getFormatted() replaces double line breaks with </p><p> and offers the option to nest the whole thing in opening and closing <p> tags. So I will probably have to get unformatted text instead and format it with Textile Restricted. I guess this will be very easy, but can’t find the right method for it. Link to comment Share on other sites More sharing options...
rash Posted March 13, 2021 Author Share Posted March 13, 2021 Got it now – a bit embarassing how long it took: $text = $comment->text; $modules->TextformatterTextileRestricted->formatValue(new Page(), new Field(), $text); Or, in my case, as I format the comments inside a function: $text = $comment->text; wire('modules')->TextformatterTextileRestricted->formatValue(new Page(), new Field(), $text); Suddenly the day showed a brighter coloring. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now