mikaelmattsson / blade

Blade for Wordpress
GNU General Public License v2.0
151 stars 21 forks source link

Blade not working #7

Closed frederikprijck closed 10 years ago

frederikprijck commented 10 years ago

Hi,

FIrst of all, I'm pretty sure this is a stupid question. Nevertheless I had no idea where else I could find any help.

I've followed the install instructions and installed + activated the blade plugin: http://prntscr.com/2u0x1u

Next thing I did was making sure the views folder is writable by setting the chmod to 777.

According to http://wordpress.org/plugins/blade/installation/ I should now be able to use blade syntax.

Next thing I did was add the following lines to a working wp template file: http://prntscr.com/2u0xwu

The output is: http://prntscr.com/2u0y9x

As you can see, it's not parsing the template engine. The page renders {{$helloWorld}}

Do you have any idea what I am missing? Since I realy appreciate bringing a template engine into wordpress, especially when it's based on Razor, ofwhich I have years of experience.

Thanks

PabloVallejo commented 10 years ago

Hi @frederikprijck, one of the caveats is that Blade won't be parsed if you are including your templates using WordPress functions like get_template_part, the_header, the_footer etc. You should use instead Blade specific functions to do so like @include( 'header' ), @include( 'footer' ) etc.

In my opinion, it's very likely that this is the reason your Blade lines aren't being parsed. https://github.com/MikaelMattsson/blade/blob/master/README.md#including-files YouTube Video

frederikprijck commented 10 years ago

I was affraid that this would be the case. This requires me to rework the entire theme from scratch. I'll give it a try asap. Thanks for reply'ing that quick!