Get value from select in second language?

Hi all,

i have a strange problem with getting a value from a select in the second language.


This is how i get the title from a select value in the main language.

$second_page->urivalue() (select value) this returns the uri of the page “/second/second_page” from which i want to get the title.

When i switch the language also the uri changes but i am not getting any title?

thx for help

ok. i am using id instead of uri now and it works .

Make sure the page exists before you call the title() method, though:

if($p = page($second_page->urivalue()) {
  echo $p->title();

Or using the ternary operator:

echo ($p = page($second_page->urivalue()))? $p->title()->html(): null;