Closed slovenianGooner closed 2 months ago
Was already working on this on the feat/pass-record-to-views branch. Had it mostly working but there is a n+1 issue with the approach when blocks are rendered on the front end.
Do you mean frontend - the "rendered" views?
yes. hard to remember exactly what I ran into, but it was mostly working.
Can you give me an example of what you would need the record for in the preview / rendered views?
Specifically,
Spatie’s Laravel Media Library. I would access the record and the filter down the media by a custom property.
Like said, no issue on the rendered blade files, I have more control there
Lp, Lovro Papež
On Fri, 2 Feb 2024 at 16:24, Adam Weston @.***> wrote:
yes. hard to remember exactly what I ran into, but it was mostly working.
Can you give me an example of what you would need the record for in the preview / rendered views?
— Reply to this email directly, view it on GitHub https://github.com/awcodes/filament-tiptap-editor/pull/320#issuecomment-1924096178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTBHJQE5OHEHQUEXMTDJDYRUAMTAVCNFSM6AAAAABCUQ4PYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRUGA4TMMJXHA . You are receiving this because you authored the thread.Message ID: @.***>
This pull request adds an additional param to the
getPreview
method to inject the current component (TiptapEditor) to each preview Blade file.This enables the user to have access ie. to the current record when editing in the panel.
Example blade file:
The same possibility does not exist on rendered blade files, you have to find other ways of injecting the record ie. example with the app container.