Custom extension is triggering code from another extension #296
Replies: 2 comments
-
Curator's modal is outside of the form, that's what allows the panel to work inside of modals since the inserted image is passed via an event listener system. Because of this Curator has an even handler for the 'open-modal' event, that's why all the functionality inside that event handler is running a check for the modal id. I think for your use case it would be better to just use a normal action instead of replicating what Curator is doing. It is a more complicated solution that what you need. |
Beta Was this translation helpful? Give feedback.
-
Hey, @awcodes . I spent the last week trying to achieve this and it was really hard because of my lack of a deeper knowledge of internals from both Tiptap and Filament. But at end, I got where I wanted. The thing is: I really tried using a normal action to open the modal when clicking the tool in the menu, but it resulted in A LOT of weird interactions and unexpected behaviors, and I believe this is due to the fact that the action was inside the field itself. The way I got everything working was just doing EXACTLY the same thing Curator does. Registering the modal view with a render hook, having a Livewire component for the modal with a "catch all" |
Beta Was this translation helpful? Give feedback.
-
Hi, folks! I'm following the README to create a custom extension. This extension will do something similar to what Curator does: when you click the extension button in the toolbar, it will open a modal to select related articles to be embedded in the contents. In fact, I'm using Curator for my media and I'm using the code to base my code on what Curator already does.
The problem I'm having, is that when I click my custom extension button in the toolbar, it opens the modal I expect it to open, , but it ALSO runs the code from the Curator panel. I'm not sure if this is something expected for some internal LW update reason or if it's in fact a bug.
If you add the following around line 85 on
filament-curator/resources/views/components/modals/curator-panel.blade.php
you will get add
when clicking the button for the custom extension, that has no relation whatsoever with curator.<!-- Gallery --> @php dd('test'); @endphp
And here's the code for the custom extension:
/my-app/resources/views/components/tiptap/extensions/embedded-articles/embedded-articles-button.blade.php
/my-app/resources/views/components/tiptap/extensions/embedded-articles/embedded-articles-modal.blade.php
/my-app/app/TiptapExtensions/EmbeddedArticle.php
/my-app/config/filament-tiptap-editor.php
/my-app/resources/js/tiptap/EmbeddedArticle.js
Beta Was this translation helpful? Give feedback.
All reactions