Search code examples
codeignitercufon

Cufon loading issue


I've used cufon plenty of times before and never had an issue, but no matter what I do with this installation I just get firebug error : "cufon not defined".

I don't have much of the page written yet so I'll post a link here so you can see it in action: http://www.stormcouriers.com/testimonials

I'm using the following code to include the files:

<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/cufon-yui.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/microgramm_400-microgramm_400.font.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/jquery-1.4.2.min.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/html5.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/common.js"/>

<script type="text/javascript">
    Cufon.replace('h2');
    Cufon.now();
</script>

All js files load correctly, so I'm scratching my head to figure this one out. The only problem I can see is that I am using a codeigniter CMS and there are a few posts on the web of prblems between CI and Cufon. Any help would be greatly appreciated.

Thanks

Dave


Solution

  • Ok figured this out - adding javascript normally into the codeignitor theme appears to work when you view the source, but doesn't run in page. Using Pyrocms I ended up including the js files using:

    {pyro:theme:js file="js/cufon-yui.js"}

    This made the javascript load correctly and therefore Cufon work.