AnotherAndrew Posted January 4, 2012 Share Posted January 4, 2012 Is there not a way for a user to style the image description field in the admin? I want a user to be able to add bold and italics to the image description field. Link to comment Share on other sites More sharing options...
AnotherAndrew Posted January 4, 2012 Author Share Posted January 4, 2012 After doing some digging, I see that this post has what I am looking for. I hope it helps someone else in the future. Basically, extending the image field module is what I needed to do it. And Ryan provided an excellent module to do this. Thanks Ryan!! http://processwire.com/talk/index.php/topic,466.0.html Link to comment Share on other sites More sharing options...
ryan Posted January 4, 2012 Share Posted January 4, 2012 I was just about to reply to this and you beat me to it. But I'll continue my original reply anyway– I was going to say that the 'description' field that goes with each image is really intended to be for the 'alt' tag of the image (though not limited to it). But as a result, it's not something that is meant to have markup in it by default. However, if you want to have markup in it there are many ways to go. The way I would probably do it is to use markdown or textile codes in the description, and then run it through that textformatter at output time so that it converts to HTML: <?php $markdown = $modules->get('TextformatterMarkdownExtra'); $description = $page->image->description; $markdown->format($description); echo $description; // outputs HTML Link to comment Share on other sites More sharing options...
AnotherAndrew Posted January 4, 2012 Author Share Posted January 4, 2012 What do you mean by "use markdown or textile codes in the description"? Is that similar to using a <b> tag? Link to comment Share on other sites More sharing options...
ryan Posted January 4, 2012 Share Posted January 4, 2012 You are missing out on some good stuff if you haven't used these before. First off, textile and markdown are considered lightweight markup languages. This is the kind of stuff that you want clients to use in places where they might otherwise have to use HTML tags: About LMLs: http://en.wikipedia.org/wiki/Lightweight_markup_language More on Markdown: http://en.wikipedia.org/wiki/Markdown More on Textile: http://en.wikipedia.org/wiki/Textile_%28markup_language%29 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