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..
HTML in File/Image descriptions
Started by interrobang, Jun 19 2012 07:38 AM
2 replies to this topic
#2
Posted 19 June 2012 - 11:37 AM
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.
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.
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













