Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Adding typekit fonts


Reply


3 Posts   742 Views

Avatar
soolan

Community Member, 11 Posts

16 April 2013 at 3:33pm

Hello every one,

I tried to embed my TYPEKIT fonts to SilverStripe.

I tried both requirements command in the controller and
editing template directly but it didn't work.

Does anyone knows how to do that?

Thanks.

P.S
the problem are script tags that need to be called to authorize the font
Here it is what typekit gives you:

<script type="text/javascript" src="//use.typekit.net/gxb3csu.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>

Avatar
Optic Blaze

Community Member, 165 Posts

17 April 2013 at 9:37am

Hi,

Post your .ss file code please. I just want to see what you have all got in there before i comment further.

Avatar
Nobrainer Web

Community Member, 137 Posts

18 April 2013 at 9:00am

Just add to the top of your themes/design/templates/Page.ss file, should look something like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xml:lang="da-DK" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://use.typekit.com/lyu4luv.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>

Remember to allow access from the urls you are viewing the site at in your typekit. (After update there can be a short delay before it actually works)