Skip to content
Snippets Groups Projects
Commit e05f6af1 authored by Rajab Natshah's avatar Rajab Natshah Committed by tyler36
Browse files

Issue #3347474: Fix Icon patch for Type Tray with the Origin URL (scheme and HTTP host) of the site

parent 6c13ee10
No related branches found
No related tags found
1 merge request!16Issue #3347474: Fix Icon patch for Type Tray with the Origin URL (scheme and HTTP host) of the site
......@@ -183,14 +183,19 @@ class TypeTrayController extends NodeController {
])->toString();
$favorite_link_action = 'add';
}
/** @var \Symfony\Component\HttpFoundation\Request $origin_url */
$origin_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBaseUrl();
$origin_url_type_tray = $origin_url . '/' . $this->moduleList->getPath('type_tray');
$build['#items'][$category][$type->id()] = [
'#theme' => 'type_tray_teaser',
'#content_type_link' => Link::createFromRoute($type->label(), 'node.add', ['node_type' => $type->id()]),
'#thumbnail_url' => !empty($settings['type_thumbnail']) ? $settings['type_thumbnail'] : '/' . $this->moduleList->getPath('type_tray') . static::TYPE_TRAY_DEFAULT_THUMBNAIL_PATH,
'#thumbnail_url' => !empty($settings['type_thumbnail']) ? $settings['type_thumbnail'] : $origin_url_type_tray . static::TYPE_TRAY_DEFAULT_THUMBNAIL_PATH,
'#thumbnail_alt' => $this->t('Thumbnail of a @label content type.', [
'@label' => $type->label(),
]),
'#icon_url' => !empty($settings['type_icon']) ? $settings['type_icon'] : '/' . $this->moduleList->getPath('type_tray') . static::TYPE_TRAY_DEFAULT_ICON_PATH,
'#icon_url' => !empty($settings['type_icon']) ? $settings['type_icon'] : $origin_url_type_tray . static::TYPE_TRAY_DEFAULT_ICON_PATH,
'#icon_alt' => $this->t('Icon of a @label content type.', [
'@label' => $type->label(),
]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment