View more context



which returns the data from that object according to the Locale/ fallbacks.


But looking around the source code I can't find anything that does this.


Am I missing something, or does this sort of method not exist?


Nevermind - I've got something that works, it's just clunkier than I expected.


I need the same thing - can you possibly post how you did it?


Hoping someone can point me to some docs I missed or a code snippet... I need to run a task that updates MetaDescriptions of all pages (of a specific type). We have these pages saved in 2 locales, so for one locale the MetaDescr is blabla1 and the other locale it's blabla2. How do I properly grab the published pages (I don't want to accidentally publish unpublised ones 😉 ) and update this field for both locales, then publish in each locale?


Can anyone help? Given a page, how can I see which locales the page is published in? (Fluent)


something like this might work (untested):

  1. $page = SiteTree::get()->byID(123);
  2. $locales = Locale::get();
  4. $localesPageIsIn = [];
  5. foreach ($locales as $locale) {
  6. if ($page->isPublishedInLocale($locale)) {
  7. $localesPageIsIn[] = $locale;
  8. }
  9. }

Nice! That did the trick (with if ($page->isPublishedInLocale($locale->Locale)) {)


Does anyone know whether it is possible to disable a locale in Fluent without actually erasing it ? I've tried unpublishing all pages, and that seems to work except it still produces "alternate" urls (both in the metatags and sitemap.xml). Erasing the 2nd locale is an option, but then I do not have to option of including the 'locale' part in the URL anymore.


I've started working on a locale menu for fluent. This should hopefully make it easier working on multiple locales on a single item.

Show 1 attachment(s)
WIP Initial commit of new localisation menu by tractorcow · Pull Request #562 · tractorcow-farm/silverstripe-fluent

Just getting the look and feel right Not sure how to fit descriptions in. Maybe tooltips that show on hover? If I get silverstripe/silverstripe-framework#9305 merged I might work on adding JS tool...

Hide attachment content
👍 (4)

@tractorcow good to see! Thanks for improving fluent. I had a customer where I added fluent to an existing site and I thought it's not always clear for him if he's in the main language or in the translation.


Maybe we need to show the failovers "you are viewing the page in <locale> This page fails over from <locale1> if not localised This page fails over to <locale2, locale3> if they are not localised"