Skip to content

Commit 2fbe114

Browse files
committed
♻️ move script to WebAssetManager
1 parent 4710faf commit 2fbe114

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/mod_breadcrumbs/tmpl/default.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99

1010
defined('_JEXEC') or die;
1111

12+
use Joomla\CMS\Factory;
1213
use Joomla\CMS\HTML\HTMLHelper;
1314
use Joomla\CMS\Language\Text;
1415
use Joomla\CMS\Uri\Uri;
16+
use Joomla\CMS\WebAsset\WebAssetManager;
1517

18+
$app = Factory::getApplication();
1619
?>
1720
<nav role="navigation" aria-label="<?php echo $module->title; ?>">
1821
<ol class="mod-breadcrumbs breadcrumb">
@@ -86,8 +89,9 @@
8689
]
8790
];
8891
}
92+
93+
/** @var WebAssetManager $wa */
94+
$wa = $app->getDocument()->getWebAssetManager();
95+
$wa->addInline('script', json_encode($data, JSON_UNESCAPED_UNICODE), [], ['type' => 'application/ld+json']);
8996
?>
90-
<script type="application/ld+json">
91-
<?php echo json_encode($data, JSON_UNESCAPED_UNICODE); ?>
92-
</script>
9397
</nav>

0 commit comments

Comments
 (0)