Skip to content

Commit

Permalink
♻️ move script to WebAssetManager
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 committed Oct 1, 2020
1 parent 4710faf commit 2fbe114
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/mod_breadcrumbs/tmpl/default.php
Expand Up @@ -9,10 +9,13 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\WebAsset\WebAssetManager;

$app = Factory::getApplication();
?>
<nav role="navigation" aria-label="<?php echo $module->title; ?>">
<ol class="mod-breadcrumbs breadcrumb">
Expand Down Expand Up @@ -86,8 +89,9 @@
]
];
}

/** @var WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
$wa->addInline('script', json_encode($data, JSON_UNESCAPED_UNICODE), [], ['type' => 'application/ld+json']);
?>
<script type="application/ld+json">
<?php echo json_encode($data, JSON_UNESCAPED_UNICODE); ?>
</script>
</nav>

0 comments on commit 2fbe114

Please sign in to comment.