File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 7373 $ uris = [];
7474 foreach (kirby ()->languages () as $ language ) {
7575 $ code = $ language ->code ();
76- $ uris [$ code ] = $ this ->model ()->uri ($ code );
76+ // re-create the uri from the public url
77+ $ currentUrl = $ this ->model ()->url ($ code ); // get the page url
78+ $ currentUri = str_replace (site ()->url (), '' , $ currentUrl ); // substract the site url to get the uri
79+ $ currentUri = '/ ' . ltrim ($ currentUri , '/ ' ); // make sure it starts by a single forward slash
80+ $ uris [$ code ] = $ currentUri ;
7781 }
7882 return $ uris ;
7983 }
8084 else {
81- return $ this ->model ()->uri ();
85+ // re-create the uri from the public url
86+ $ currentUrl = $ this ->model ()->url (); // get the page url
87+ $ currentUri = str_replace (site ()->url (), '' , $ currentUrl ); // substract the site url to get the uri
88+ $ currentUri = '/ ' . ltrim ($ currentUri , '/ ' ); // make sure it starts by a single forward slash
89+ return $ currentUri ;
8290 }
8391 },
8492 'lang ' => function () {
You can’t perform that action at this time.
0 commit comments