Jump to:

1368 Posts in 487 Topics by 521 members

Themes

SilverStripe Forums » Themes » Where to place jQuery-UI theme & how to link to it properly.

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1843 Views
  • vwd
    Avatar
    Community Member
    158 Posts

    Where to place jQuery-UI theme & how to link to it properly. Link to this post

    Hi,

    I am using a jQuery UI theme for the SS theme/template that I'm developing.

    Where would be the best place to locate the jQuery UI theme files? I currently have it in a folder (jquery-ui-theme/) in my theme's folder. And I'm linking to it using:

    Requirements::css('themes/mytheme/jquery-ui-theme/vader/jquery-ui-1.8.2.custom.css');

    This doesn't seem to be the best approach - I feel that it would be better to programatically select the theme, not hardcode it... How do I use THEME_PATH or something like that? It doesn't seem to like it when I try...

    Requirements::css(THEMES_DIR . '/' . self::$theme . '/jquery-ui-theme/vader/jquery-ui-1.8.2.custom.css');

    Thanks very much.
    VWD.

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Where to place jQuery-UI theme & how to link to it properly. Link to this post

    try...

    Requirements::css('themes/'.SSViewer::current_theme().'/jquery-ui-theme/vader/jquery-ui-1.8.2.custom.css');

    or in the template... maybe... using $ThemeDir and...

    <% require javascript(mysite/javascript/LeftAndMain.js) %>

    hmmm I can't find an example of the second (I know $themeDir works and <% require %> but haven't used together), best stick with the first

  • vwd
    Avatar
    Community Member
    158 Posts

    Re: Where to place jQuery-UI theme & how to link to it properly. Link to this post

    Hi Swaiba,

    Fantastic!

    Requirements::css('themes/'.SSViewer::current_theme().'/jquery-ui-theme/vader/jquery-ui-1.8.2.custom.css');

    ...works well.

    Thanks very much for your response Swaiba.

    VWD.

    PS. From a proper MVC design perspective, since this jQUery theme is tied in with my SS theme/template, do you agree that the jQuery theme files should be located within SS theme folder?

    1843 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.