Zahari M. Posted August 21, 2013 Share Posted August 21, 2013 Hey Ryan One for your consideration... I wanted to be able to do two things to the Description text that appears in our admin fields. Add a link to some text and emphasize some text. Currently inputfields.php only accepts Markdown syntax to identify a link via $str = preg_replace('/\[(.+?)\]\(([^)]+)\)/', '<a href="$2" target="_blank">$1</a>', $str); Extending this by adding an additional pattern to catch the Markdown syntax for emphasis which is ** Wrapped In Double Asterisks ** ... $str = preg_replace('/\[(.+?)\]\(([^)]+)\)/', '<a href="$2" target="_blank">$1</a>', $str); $str = preg_replace('/\*\*(.*?)\*\*/', '<strong>$1</strong>', $str); Now gives us the ability to emphasize text. Adding a rule to main.css such as this would round this solution off... .content .description strong { color: #444444; font-weight: bold; } Screenshot for proof of concept available at the bottom of this thread: http://processwire.com/talk/topic/4313-how-do-we-enable-html-tags-in-fields-setup-description-box/ Thanks for reading and hope it may be worthy of inclusion into core! Cheers 2 Link to comment Share on other sites More sharing options...
ryan Posted August 22, 2013 Share Posted August 22, 2013 Makes sense to me, I'll add it. Thanks. 2 Link to comment Share on other sites More sharing options...
Zahari M. Posted August 23, 2013 Author Share Posted August 23, 2013 Thanks a bunch Ryan! Have an awesome 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