How to install Typekit?
Rate this topic: 




1.00 out of 6 based on 1 vote(s)






- GK User
- Wed Jul 02, 2014 3:07 pm
- Reply with quote
- Report this post
Basically I have used typekit in Wordpress before and it is very easy to implement on a site-wide basis, but I can't figure out how to install scripts site-wide in Joomla. The script goes something like this:
<script type="text/javascript" src="//use.typekit.net/XXXXX.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
Where could i put this script so that it can be applied on all text across the site? Thanks
<script type="text/javascript" src="//use.typekit.net/XXXXX.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
Where could i put this script so that it can be applied on all text across the site? Thanks
-
- Fresh Boarder
- teitbite
- Wed Jul 02, 2014 5:18 pm
- Reply with quote
- Report this post
Hi
Best place will be to add it at the bottom of /layout/blocks/head.php file in tempalte.
Best place will be to add it at the bottom of /layout/blocks/head.php file in tempalte.
-
- Moderator
- GK User
- Tue Aug 26, 2014 1:36 am
- Reply with quote
- Report this post
Hi!
Could you tell me in which files should I paste the Typekit codes for the Joomla! Events template?
Could you tell me in which files should I paste the Typekit codes for the Joomla! Events template?
-
- Fresh Boarder
- teitbite
- Tue Aug 26, 2014 2:34 pm
- Reply with quote
- Report this post
Hi
/layout/blocks/head.php is the file included between <head></head> which is best place to include files for website.
/layout/blocks/head.php is the file included between <head></head> which is best place to include files for website.
-
- Moderator
- GK User
- Sun Oct 12, 2014 4:35 am
- Reply with quote
- Report this post
Hi.
I copied this script in the file you mentioned and it provoked an error message exactly about the line where the script is.
<script src="//use.typekit.net/wxyz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
¿Is there any specific syntax I should use to make it work?
In case we get to make it work, would this CSS be enough to get the font in every header tag?
h1,h2,h3,h4,h5,h6 {
font-family: "adobe-garamond-pro", serif !important;
font-weight: regular;
}
Any help will be appreciated.
Thanks in advance
I copied this script in the file you mentioned and it provoked an error message exactly about the line where the script is.
<script src="//use.typekit.net/wxyz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
¿Is there any specific syntax I should use to make it work?
In case we get to make it work, would this CSS be enough to get the font in every header tag?
h1,h2,h3,h4,h5,h6 {
font-family: "adobe-garamond-pro", serif !important;
font-weight: regular;
}
Any help will be appreciated.
Thanks in advance

-
- Fresh Boarder
- teitbite
- Mon Oct 13, 2014 2:00 pm
- Reply with quote
- Report this post
Hi
Script looks ok, so maybe the place You have copied it is relevant here. What is the error message You have in mind ?
Script looks ok, so maybe the place You have copied it is relevant here. What is the error message You have in mind ?
-
- Moderator
- GK User
- Tue Oct 14, 2014 6:23 am
- Reply with quote
- Report this post
I get this error:
Parse error: syntax error, unexpected '<' in /home/fravar2/ibdf.mx/website/templates/gk_events/layouts/blocks/head.php on line 5
When I copy the script in the head.php file like this:
<?php
// This is the code which will be placed in the head section
<script src="//use.typekit.net/wxyz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
// No direct access.
defined('_JEXEC') or die;
$this->addTemplateFavicon();
// check the color version
$template_style = $this->getTemplateStyle('style');
// load the CSS files
if(!file_exists(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php')) {
$this->API->addCSS($this->API->URLtemplate() . '/css/k2.css');
}
Parse error: syntax error, unexpected '<' in /home/fravar2/ibdf.mx/website/templates/gk_events/layouts/blocks/head.php on line 5
When I copy the script in the head.php file like this:
<?php
// This is the code which will be placed in the head section
<script src="//use.typekit.net/wxyz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
// No direct access.
defined('_JEXEC') or die;
$this->addTemplateFavicon();
// check the color version
$template_style = $this->getTemplateStyle('style');
// load the CSS files
if(!file_exists(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php')) {
$this->API->addCSS($this->API->URLtemplate() . '/css/k2.css');
}
-
- Fresh Boarder
- teitbite
- Wed Oct 15, 2014 10:31 am
- Reply with quote
- Report this post
Hi
Yes, just as I thought. it's a wrong place to add this, but if You want it to be used here close php tags before and open after the code again. Like this:
Yes, just as I thought. it's a wrong place to add this, but if You want it to be used here close php tags before and open after the code again. Like this:
- Code: Select all
?>
<script src="//use.typekit.net/wxyz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<?php
-
- Moderator
8 posts
• Page 1 of 1