F
Filamentβ€’9mo ago
astronomic

{!! !!} 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:
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.
Jump to solution
7 Replies
Dennis Koch
Dennis Kochβ€’9mo ago
Without HTML or styling? Did you check the source code? For styling you probably want a prose CSS class
astronomic
astronomicβ€’9mo ago
Hi Dennis! for example, don't show the lists, or strong tag
Dennis Koch
Dennis Kochβ€’9mo ago
Did you check the source code?
astronomic
astronomicβ€’9mo ago
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?
astronomic
astronomicβ€’9mo ago
In the source code the labels do appear, but in the modal they are not seen as such.
No description
Solution
Dennis Koch
Dennis Kochβ€’9mo ago
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.
astronomic
astronomicβ€’9mo ago
Omgshh yeeeah!! xDD thank you so much!! πŸ˜„
Want results from more Discord servers?
Add your server
More Posts