Another problem.
If i set Hanna Code Text Formatter for the field body and then want to output the body field in my template via PHP, all other code from my Hanna Code snippet is overwritten. Only the field $page->body appears.
To clarify, here is what i got:
Field with the name body -> Text Formatter: Hanna Code Text Formatter
Hanna code:
!HannaCode:newsdetails:eyJuYW1lIjoibmV3c2RldGFpbHMiLCJ0eXBlIjoiMiIsImNvZGUiOiJlY2hvICRwYWdlLT50aXRsZTtcclxuXHJcblxyXG5pZigkcGFnZS0+dGh1bWJuYWlsKXtcclxuXHQkaW1hZ2UgPVwiPGEgaHJlZj0neyRwYWdlLT50aHVtYm5haWwtPnVybH0nIGNsYXNzPSdsaWdodGJveCc+XCI7XHJcblx0JGltYWdlIC49XCI8aW1nIGNsYXNzPSdwdWxsLXJpZ2h0IGltZy1wb2xhcm9pZCcgc3JjPSd7JHBhZ2UtPnRodW1ibmFpbC0+d2lkdGgoMjAwKS0+dXJsfSc+XCI7XHJcblx0XHRcdFx0XHRcL1wvICRpbWFnZSAuPVwiPGltZyBjbGFzcz0ncHVsbC1yaWdodCBpbWctcG9sYXJvaWQnIHNyYz0neyRwYWdlLT50aHVtYm5haWwtPmdldFRodW1iKHRodW1ibmFpbCl9Jz5cIjtcclxuXHQkaW1hZ2UgLj1cIjxcL2E+XCI7XHJcbn1cclxuXHJcbmVjaG8gJGltYWdlO1xyXG5lY2hvICRwYWdlLT5ib2R5O1x0In0=/!HannaCode
here is the PHP for the Hanna Code:
echo $page->title;
if($page->thumbnail){
$image ="<a href='{$page->thumbnail->url}' class='lightbox'>";
$image .="<img class='pull-right img-polaroid' src='{$page->thumbnail->width(200)->url}'>";
// $image .="<img class='pull-right img-polaroid' src='{$page->thumbnail->getThumb(thumbnail)}'>";
$image .="</a>";
}
echo $image;
echo $page->body;
template newsdetail.php
<?php
$hanna = $modules->get('TextformatterHannaCode');
echo $hanna->render('[[newsdetails]]');
?>
When i open the page, only the contents of the body field appear.
No Hanna Code is actually used in the body field. Just plain text!!!!
If i remove the text formatter for the body field, everything works fine.
But sometimes i want to use Hanna Code in my body field as well.
So how do i do that?