How to place language switcher outside of panel

I am trying to place the language switcher outside of my panel with
<livewire:filament-language-switch key='fls-outside-panels' />
<livewire:filament-language-switch key='fls-outside-panels' />
but that does not work. I am using https://github.com/bezhanSalleh/filament-language-switch Maybe someone knows how to do this?
GitHub
GitHub - bezhanSalleh/filament-language-switch: A versatile and use...
A versatile and user-friendly plugin designed for Filament Panels. - bezhanSalleh/filament-language-switch
22 Replies
TheNastyPasty
TheNastyPasty2mo ago
This is what I get
Dennis Koch
Dennis Koch2mo ago
Best to ask in the plugin channel #bezhansalleh-language-switch You did see the docs about this?https://github.com/bezhanSalleh/filament-language-switch?tab=readme-ov-file#outside-panel-routes
GitHub
GitHub - bezhanSalleh/filament-language-switch: A versatile and use...
A versatile and user-friendly plugin designed for Filament Panels. - bezhanSalleh/filament-language-switch
Dennis Koch
Dennis Koch2mo ago
GitHub
GitHub - bezhanSalleh/filament-language-switch: A versatile and use...
A versatile and user-friendly plugin designed for Filament Panels. - bezhanSalleh/filament-language-switch
TheNastyPasty
TheNastyPasty2mo ago
Thanks you for you answer I will have a look. Yes I asked about it in the plugin channel No answer until now Tried that already but I dont know how that should work
Dennis Koch
Dennis Koch2mo ago
Checked the Channel. Bezhan is not at his computer until 20th May. Which part you don't understand? And I guess your issue comes from not having a theme?
TheNastyPasty
TheNastyPasty2mo ago
I dont understand the theming part. I added my custom route
->outsidePanelRoutes([
'profile',
'login',
'register',
'pages.show',
])
->outsidePanelRoutes([
'profile',
'login',
'register',
'pages.show',
])
and updated my tailwind config
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./vendor/bezhansalleh/filament-language-switch/resources/views/language-switch.blade.php',
],
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./vendor/bezhansalleh/filament-language-switch/resources/views/language-switch.blade.php',
],
Dennis Koch
Dennis Koch2mo ago
Wait. Since you are using this outside the panel, that doesn't 100% apply to you. But you have a separate Tailwind config for your "outside panel" page? And you recompiled your CSS?
TheNastyPasty
TheNastyPasty2mo ago
My tailwind config is in root, yes also recompiled
Dennis Koch
Dennis Koch2mo ago
Hm. I don't know the plugin so I can't help much. I'd say: Check the output HTML and see whether the classes that are used are actually included in your Tailwind build.
TheNastyPasty
TheNastyPasty2mo ago
Thanks for your help
Dennis Koch
Dennis Koch2mo ago
Is your "outside panel" project using Livewire? The plugin assumes you have AlpineJS. Maybe you have a error in your Devtools console
TheNastyPasty
TheNastyPasty2mo ago
Its always collapsed If I click the button I get
$refs.panel.toggle is not a function
$refs.panel.toggle is not a function
and I can't switch languages No removed it like it is stated in the filament docs livewire.js?id=770f7738:1123 Alpine Expression Error: $refs.panel.toggle is not a function
Dennis Koch
Dennis Koch2mo ago
You removed it from Composer but not from the project, right? I can't find any code related to this inside the plugin. Are you sure the error is coming from the plugin?
TheNastyPasty
TheNastyPasty2mo ago
It ships with filament What I did so far Added that to my blade
<livewire:filament-language-switch key='fls-outside-panels' />
<livewire:filament-language-switch key='fls-outside-panels' />
tailwind config
'./vendor/bezhansalleh/filament-language-switch/resources/views/language-switch.blade.php',
'./vendor/bezhansalleh/filament-language-switch/resources/views/language-switch.blade.php',
added custom page
->outsidePanelRoutes([
'profile',
'login',
'register',
'pages.show',
])
->outsidePanelRoutes([
'profile',
'login',
'register',
'pages.show',
])
Dennis Koch
Dennis Koch2mo ago
Is the error coming from the plugin? Or is it already there before you add it?
TheNastyPasty
TheNastyPasty2mo ago
The error appears after clicking the button The switcher button
Dennis Koch
Dennis Koch2mo ago
Btw: Why are you including a Livewire component? I can't find that on the readme?
TheNastyPasty
TheNastyPasty2mo ago
Found that in thread here didn't know how to do it otherwise
Dennis Koch
Dennis Koch2mo ago
I guess "outside panel" means for guest pages and not for "non-filament" pages.
TheNastyPasty
TheNastyPasty2mo ago
Ahh ok! Thanks how could I do it then? Any idea? Would be so grateful
Dennis Koch
Dennis Koch2mo ago
Not sure whether that's right. Just my feeling. You probably need to build this yourself then.
TheNastyPasty
TheNastyPasty2mo ago
Ok thank you