Alex Posted February 9, 2012 Share Posted February 9, 2012 A quick question, what type of text field supports line breaks? I have a navigation list, I want to be able to break the text onto a second line where I choose. I have been using a textarea field then changing the Inputfield Type to TinyMCE. Is there a better way where I don't get all the tinyMCE formatting options? thanks Alex Link to comment Share on other sites More sharing options...
diogo Posted February 9, 2012 Share Posted February 9, 2012 you can use Markdown or Textile: http://processwire.c...text-formatter/ or, if the only thing you want is the <br> where there is a new line; you can use "nl2br" on a regular text area: http://php.net/manua...ction.nl2br.php <?php echo nl2br($page->field); ?> 4 2 Link to comment Share on other sites More sharing options...
apeisa Posted February 9, 2012 Share Posted February 9, 2012 Diogo is right. There is also textformatter for nl2br, so just use regular textarea and edit it details page and add "Newlines to XHTML line breaks" textformatter. You probably need to install the required module first: Newlines to XHTML Line Breaks 3 Link to comment Share on other sites More sharing options...
diogo Posted February 9, 2012 Share Posted February 9, 2012 Ha!! Didn't know that one The module is not active by default. And there is also a Newlines to Unordered List handy! edit: why aren't they active by default? 1 Link to comment Share on other sites More sharing options...
Alex Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks guys, nice to know about these little extra features. I will play with this over the weekend. 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