interrobang Posted June 19, 2012 Posted June 19, 2012 I need to use some simple html-tags like <b> in file descriptions but they get stripped after save. Is there some option to allow html in file/image descriptions? In my case its sufficient to enter the html-tags by hand, but would it be possible to use tinymce for editing the description? I know I can use repeaters as an alternative, I just love the multi-file upload of the file-fieldtype so much..
ryan Posted June 19, 2012 Posted June 19, 2012 I recommend using either Textile or Markdown if you need to support this type of stuff in your image/file descriptions. For instance, in Markdown you would make bold text **like this** You'll need to run your image/file descriptions through Textile or Markdown before outputting them. So can do that like this. I'll use Markdown in this example since the module is already in the core. $markdown = $modules->get('TextformatterMarkdownExtra'); $description = $page->image->description; // your image description $markdown->format($description); echo "<p><img src='{$page->image->url}' alt='' /> $description</p>"; We'll likely add internal support for these Textformatters for image/file descriptions in the near future, so that you don't have to do the above if you don't want to. 2
interrobang Posted June 19, 2012 Author Posted June 19, 2012 Thank you Ryan, your idea works perfectly fine in my use case. This is even better then entering tags! I always forget these Textformatters exist. Nice to hear they will get internal support!
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