bezhanSalleh / filament-language-switch

A versatile and user-friendly plugin designed for Filament Panels.
MIT License
210 stars 45 forks source link

'panels::global-search.after' render hook name not (always) working #44

Closed KonradHambuch closed 1 year ago

KonradHambuch commented 1 year ago

@bezhanSalleh

If I leave $renderHookName as set, nothing shows, but if I change it to other render hooks, it displays there.

for example:

panels::topbar.end image

I think this is beacuse in documentation there is no 'panels::global-search.after', there is 'panels::global-search.end', but that shows language-switch panel only if there is a global search component on the panel and looks like this, with no margin: image

I suggest maybe using 'panels::user-menu.before'? :|

bezhanSalleh commented 1 year ago

This hook was added in filament v3. So if you are using v2 use the v1 filament-language-switch.

KonradHambuch commented 1 year ago

I use V3, but none of them uses 'after' for global-search component.

V3: https://filamentphp.com/docs/3.x/support/render-hooks#:~:text=panels%3A%3Aglobal%2Dsearch.end V2 https://filamentphp.com/docs/2.x/admin/appearance#render-hooks:~:text=global%20search%20input-,global%2Dsearch.end,-%2D%20after%20global%20search

ibrahimBougaoua commented 1 year ago

I faced the same problem,there is a simple style issue with others hooks, Use this hook it's work perfectly.

FilamentLanguageSwitchPlugin::make() ->renderHookName('panels::user-menu.before'),

bezhanSalleh commented 1 year ago

@KonradHambuch @ibrahimBougaoua These render hooks panels::global-search.before & panels::global-search.after were created to address a PR i made to fix the design issue. So that's how I know; neither of you are on v3 🎤 🖖. given that v3 is 2weeks old, it wasn't documented until now. https://github.com/filamentphp/filament/pull/7762