Cannot render trixRitchText without Editor ?
midsonlajeanty opened this issue · 2 comments
midsonlajeanty commented
when i use this syntax into blade view :
@trix($post, 'content')
{!! $post->trix('content') !!} //must use HasTrixRichText trait in order for $model->trix() method work
{!! app('laravel-trix')->make($post, 'content') !!}
the trix editor is render, but i need to render only html string. How con i make it ?
d4rkm0d3324 commented
One way I did was to render without the toolbar and through JavaScript, disable editing.
BLADE:
@trix($post, 'content', [ 'hideToolbar' => true ])
JS:
<script>
var trixEditor = document.querySelector('trix-editor');
trixEditor.setAttribute('contenteditable', false);
</script>
midsonlajeanty commented
Thanks ...