Jump to:

3435 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » CSS file/s is being loaded twice - Silverstripe 3

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

Page: 1
Go to End
Author Topic: 1148 Views
  • ss_poser
    Avatar
    Community Member
    1 Post

    CSS file/s is being loaded twice - Silverstripe 3 Link to this post

    hi,

    i have this code in my project that combine all the css files into one file.

    Page.php

       public function init() {
          parent::init();

          //Set our theme's root folder
    $themeFolder = $this->ThemeDir();

    //Add all the files to combine into an array
    $CSSFiles = array(
    $themeFolder . '/css/reset.css',
    $themeFolder . '/css/fonts.css',
    $themeFolder . '/css/style.css',
    $themeFolder . '/css/coupons.css'
    );

    //Set the folder to inside our theme so that relative css image paths work
    Requirements::set_combined_files_folder('assets/' . 'combinedfiles');

    //Combine!
    Requirements::combine_files("combinedCSS.css", $CSSFiles);

       }

    without calling it in the template, it is being loaded twice.

    I also tried including all my css files in the template, but the same thing also happened. They are loaded twice.

    it will be much appreciated if someone can help me on this.

    Thanks!

  • t|m
    Avatar
    Community Member
    19 Posts

    Re: CSS file/s is being loaded twice - Silverstripe 3 Link to this post

    Hi there,

    am experiencing the same problem.
    Looks very much like a bug.

    Can you confirm that your <head></head> is in an included template?

    Cheers

  • Julius0815
    Avatar
    Community Member
    3 Posts

    Re: CSS file/s is being loaded twice - Silverstripe 3 Link to this post

    Hi there,

    any news on this ?

  • Willr
    Avatar
    Forum Moderator
    5490 Posts
  • t|m
    Avatar
    Community Member
    19 Posts

    Re: CSS file/s is being loaded twice - Silverstripe 3 Link to this post

    Thanks!

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