This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDPA-4450] turns off truncated alias in the list (#59)
- Loading branch information
1 parent
96ba75f
commit 1c6ec7b
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Drupal\tide_site; | ||
|
||
use Drupal\Core\Entity\EntityInterface; | ||
use Drupal\Core\Url; | ||
use Drupal\path\PathAliasListBuilder; | ||
|
||
/** | ||
* TideSitePathAliasListBuilder. | ||
* | ||
* We don't want the alias link to be truncated in the listing page. | ||
*/ | ||
class TideSitePathAliasListBuilder extends PathAliasListBuilder { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildRow(EntityInterface $entity) { | ||
$parent = parent::buildRow($entity); | ||
$alias = $entity->getAlias(); | ||
$path = $entity->getPath(); | ||
$url = Url::fromUserInput($path); | ||
$parent['data']['alias']['data'] = [ | ||
'#type' => 'link', | ||
'#title' => $alias, | ||
'#url' => $url->setOption('attributes', ['title' => $alias]), | ||
]; | ||
return $parent; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters