Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Cufon and Silverstripe

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1992 Views
  • mhull
    Avatar
    Community Member
    79 Posts

    Cufon and Silverstripe Link to this post

    Just wondering if anyone has cufon working with Silverstripe. Just starting to look into this, as I have always used Sifr, but wondered if anyone had this working? Also how hard would it be to make a cufon Module do you think?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Cufon and Silverstripe Link to this post

    I never heard of cufon, but it sounds interesting (for all others that are interested: http://wiki.github.com/sorccu/cufon).
    Apparently, you can do the font conversion online (http://cufon.shoqolate.com/generate/), all that is left to do is add some JavaScript and you're done.
    Creating a module for such a basic/simple thing seems like overkill. Or what did you have in mind for a module?

  • mhull
    Avatar
    Community Member
    79 Posts

    Re: Cufon and Silverstripe Link to this post

    I guess a module could help with the intergration with Silverstripe, handle the requirements/file includes and make it a simpler option to intergrate with Silverstripe than Sifr which I find can be slow to load.

    I see there is a wordpress module for Cufon that already exists, and I guess it may be worth looking at this to see what configuration options this offers and see whether a similar module could be made for Silverstripe

  • kcd
    Avatar
    Community Member
    54 Posts

    Re: Cufon and Silverstripe Link to this post

    I'm replying awfully late however someone may like find this useful...

    Silverstripe moves the order of the required javascript. Work within this and Cufon will work.

    Stop putting js in the body (http://silverstripe.org/template-questions/show/4815)

    _config.php

    Requirements::set_write_js_to_body(false);

    Cufon.replace must be last so create the following to suit your needs

    mysite/javascript/cufonreplace.js

    Cufon.replace('h1')('h2')('h4');

    Page.ss head (at the end)

    <% require themedCSS(layout) %>
    ...
    <% require javascript(mysite/javascript/cufon-yui.js) %>
    <% require javascript(mysite/javascript/mycufonfontfile.font.js) %>
    <% require javascript(mysite/javascript/cufonreplace.js) %>

    Page.ss body(at the end, but before any other scripts)

    <body>
    ....
    <script type="text/javascript"> Cufon.now(); </script>
    </body>

    Hope that helps

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Cufon and Silverstripe Link to this post

    Adding the to

    Requirements::customScript("Cufon.replace('h1')('h2')('h4');");

    will load the Cufon call as last, so you can keep the js inclusion in the body.

    1992 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.