Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 9e8649c8 authored by escuriola's avatar escuriola
Browse files

OEL-1147: Twig function to prepare section titles. Fix url issues.

parent 50efe5b2
No related branches found
No related tags found
1 merge request!81OEL-1147 - Footer
......@@ -7,6 +7,7 @@ namespace Drupal\oe_whitelabel_helper\TwigExtension;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
use Drupal\oe_whitelabel_helper\EuropeanUnionLanguages;
use Drupal\Core\Url;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
......@@ -122,6 +123,9 @@ class TwigExtension extends AbstractExtension {
$altered_links = [];
foreach ($links as $link) {
if ($link['href'] instanceof Url) {
$link['href'] = $link['href']->toString();
}
$altered_link = [
'label' => $link['label'],
'path' => $link['href'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment