mirror of
https://github.com/getgrav/grav.git
synced 2026-02-19 21:18:10 +01:00
Flex pages: Use translated titles / routes in admin list
This commit is contained in:
@@ -303,6 +303,7 @@ class PageIndex extends FlexPageIndex
|
||||
$child->routable() ? 'routable' : 'non-routable'
|
||||
];
|
||||
$lang = $child->findTranslation($language) ?? 'n/a';
|
||||
$child = $child->getTranslation($language) ?? $child;
|
||||
$extras = [
|
||||
'template' => $child->template(),
|
||||
'lang' => $lang ?: null,
|
||||
|
||||
@@ -56,8 +56,8 @@ trait PageLegacyTrait
|
||||
*/
|
||||
public function raw($var = null): string
|
||||
{
|
||||
// TODO:
|
||||
if (null !== $var) {
|
||||
// TODO:
|
||||
throw new \RuntimeException(__METHOD__ . '(string): Not Implemented');
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ trait PageLegacyTrait
|
||||
*/
|
||||
public function frontmatter($var = null): string
|
||||
{
|
||||
// TODO:
|
||||
if (null !== $var) {
|
||||
// TODO:
|
||||
throw new \RuntimeException(__METHOD__ . '(string): Not Implemented');
|
||||
}
|
||||
|
||||
@@ -689,8 +689,8 @@ trait PageLegacyTrait
|
||||
*/
|
||||
public function filePath($var = null): ?string
|
||||
{
|
||||
// TODO:
|
||||
if (null !== $var) {
|
||||
// TODO:
|
||||
throw new \RuntimeException(__METHOD__ . '(string): Not Implemented');
|
||||
}
|
||||
|
||||
|
||||
@@ -309,8 +309,8 @@ trait PageRoutableTrait
|
||||
*/
|
||||
public function path($var = null): ?string
|
||||
{
|
||||
// TODO:
|
||||
if (null !== $var) {
|
||||
// TODO:
|
||||
throw new \RuntimeException(__METHOD__ . '(string): Not Implemented');
|
||||
}
|
||||
|
||||
@@ -388,7 +388,13 @@ trait PageRoutableTrait
|
||||
$directory = $this->getFlexDirectory();
|
||||
$parentKey = ltrim(dirname("/{$this->getKey()}"), '/');
|
||||
if ($parentKey) {
|
||||
return $directory->getObject($parentKey);
|
||||
$parent = $directory->getObject($parentKey);
|
||||
$language = $this->getLanguage();
|
||||
if ($language) {
|
||||
$parent = $parent->getTranslation($language) ?? $parent;
|
||||
}
|
||||
|
||||
return $parent;
|
||||
}
|
||||
|
||||
$index = $directory->getIndex();
|
||||
|
||||
Reference in New Issue
Block a user