For my form plugin I'm using a global set of fields. These can be set in 2 languages
Problem is whenever I try to output them I cant dynamically make them use the current site locale/multi-site.
This is the current code:
$localeHandle = Craft::$app->getSites()->getCurrentSite()->handle; // form texts $entries = GlobalSet::find() ->siteId('*') ->site($localeHandle) ->handle('popupContact') ->asArray() ->one();
$localeHandle is set to either
en it works. I cant figure out how to get the handle though. Documentation doesn't state anything either.
Craft::$app->getSites()->getCurrentSite()->handle; returns the default site handle.