Jump to content

Recommended Posts

Posted

We have a three language web site - 'de', 'en', 'fr' with 'de' being the default.

There are pages for which we want to use the name (it's unique within its parent-scope) as in the attachment.

But when I fetch the name it does not return the name for the language - it always returns the name for the default language (guertel, in this case).

I've tried $page->getLanguageValue($lang, 'name'), but name is not a "real" field, so it returns null.

I can hack around it by extracting the last segment of the URL associated with that page (which is language sensitive) but it seems like I must be missing something.

Is there some way to fetch $page->name for the $user->language setting?

 

 

Screenshot from 2017-04-13 08-12-50.png

Posted

Thanks. I hadn't seen those functions.

Any idea why it doesn't return a language-specific name by default? The URL is language-specific by default, so $page->localUrl() isn't really needed as I can get that value just by using $page->url.

 

Posted

Is there a particular reason why $page->localUrl() returns "" even if the backend says it’s not empty (as the value is inherited from the default language)?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...