{!! !!} directive for rich editor field does not work in modal
I try to display a text from a rich editor field, with html, but it doesn't work. Show text without html. Can somebody help me?
View:
<div class="relative overflow-x-auto filament-tables-table-container">
<h3 class="font-bold text-l">Objectiu: {{ $course->Objective ? $course->Objective->name : '' }}</h3>
<div class="mt-4">
<p>{!! $course->Objective->objectives !!}</p>
</div>
<h3 class="mt-8 font-bold tracking-tight filament-header-heading text-l">Contingut: {{ $course->Content ? $course->Content->name : '' }}</h3>
<div class="mt-4">
<p>{!! $course->Content ? $course->Content->contents : '' !!}</p>
</div>
</div>
The modal in page custom:
protected function getActions(): array
{
return [
Actions\ViewAction::make('objectives_contents')
->label('Objectius i continguts')
->color('success')
->action(fn () => $this->course)
->modalContent(fn (): View => view(
'filament.pages.objectives-contents', ['course' => $this->course],
))
->modalActions([])
->modalHeading('Objectius i continguts del curs'),
];
}
Solution:Jump to solution
That what I meant. I does output HTML, but you don't have any CSS styling. You need Tailwinds
.prose
class to style HTML elements without applying a class to each of them.7 Replies
Without HTML or styling? Did you check the source code? For styling you probably want a
prose
CSS classHi Dennis! for example, don't show the lists, or strong tag
Did you check the source code?
Sorry, but what do you mean? my level of english is low π’
Are you referring to looking at the source code of the modal to see if the html tags appear?
In the source code the labels do appear, but in the modal they are not seen as such.
Solution
That what I meant. I does output HTML, but you don't have any CSS styling. You need Tailwinds
.prose
class to style HTML elements without applying a class to each of them.Omgshh yeeeah!! xDD thank you so much!! π