#1 October 9, 2012 12:15pm

AlexBall
Member
Registered: October 9, 2012
Posts: 5

Hello, all

Hello BigTree'ers,


I'm new to the BigTreeCMS world, but learning quickly and liking what I'm seeing. I realize after browsing the discussion boards that there have been a lot of changes to the way things work in the CMS, and the boards aren't overly active, but I'll definitely be posting questions here.


First up, using LESS.


One of the previous posts makes it seem that BigTree will auto compile LESS if it's included in the $bigtree["config"] variable in config.php - am I right in interpreting it that way?


Alex

Offline

#2 October 9, 2012 12:23pm

Farnsworth
Member
Registered: March 30, 2012
Posts: 13

Re: Hello, all

Hi Alex,

BigTree will auto-compile LESS if you include the file in $bigtree["config"]["css"]["files"]. Just make sure to use the .less file extension.

For example, the following will compile "less_file.less", combine it with "css_file.css", and cache the resulting file - in this case "compiled.css".
$bigtree["config"]["css"]["files"]["compiled"] = array(
    "less_file.less",
    "css_file.css"
)

Offline

#3 October 9, 2012 12:25pm

AlexBall
Member
Registered: October 9, 2012
Posts: 5

Re: Hello, all

Do you also have to include less.js in the JS array? And does this compile on the front-end (with the accompanying taxingness (not a word, I know), on the front-end?)


Is it still better to compile locally?

Offline

#4 October 9, 2012 12:33pm

Farnsworth
Member
Registered: March 30, 2012
Posts: 13

Re: Hello, all

There's no need to include less.js. BigTree uses lessphp http://leafo.net/lessphp/. File compilation, concatenation, and 'minification' occurs only on the first request after a component file is modified.
So, the first visitor to your site after you modify a LESS file will see slight performance hit on page load. All later visitors will be served he cached file, with no performance hit.




Offline

#5 October 9, 2012 12:37pm

AlexBall
Member
Registered: October 9, 2012
Posts: 5

Re: Hello, all

Perfect, so as long as that first person is me, we're in business.


Thanks!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.