Quantcast
Channel: Neueste Diskussionen - Shopware Community Forum
Viewing all articles
Browse latest Browse all 14594

Einbinden einer Schrift über protected $javascript

$
0
0

Hallo!

Ich versuche gerade eine Schrift von MyFonts.com als 30-Tage Testversion in Shopware 5.2 einzubinden.

Ich ging wie folgt vor:
Javascriptdatei "myFontTestschriften.js" anlegen

<script type="text/javascript">
    (function() {
        var path = '//easy.myfonts.net/v2/js?sid=206566(font-family=FF+DIN+Round+Pro+Medium)&sid=206567(font-family=FF+DIN+Round+Pro+Bold)&sid=206569(font-family=FF+DIN+Round+Pro+Light)&sid=236049(font-family=FF+DIN+Round+OT+Regular)&key=ejWa5E49CI',
            protocol = ('https:' == document.location.protocol ? 'https:' : 'http:'),
            trial = document.createElement('script');
        trial.type = 'text/javascript';
        trial.async = true;
        trial.src = protocol + path;
        var head = document.getElementsByTagName("head")[0];
        head.appendChild(trial);
    })();
</script>

Diese habe ich abgelegt unter:
themes/Frontend/meinTemplate/frontend/_public/src/js

dann habe ich im Theme "meinTemplate" diese JavaScript-Datei als Variable eingebunden

protected $javascript = array(
    'themes/Frontend/meinTemplate/frontend/_public/src/js/myFontTestschriften.js'
);

 

Danach habe ich in der CSS-Datei

@font-base-stack:"'FF DIN Round Pro Medium'";

 

 

Leider findet man nun nach dem Kopmilieren des Thems weder auf der Seite im Quellcode  der Scriptsource noch wird die Schrift auf der Seite verwendet. 

Was mache ich hier falsch?

 

Danke für alle Tipps!

Viele Grüße

Wilhelm Walker


Viewing all articles
Browse latest Browse all 14594


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>