Jump to:

3392 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » include does not work

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

Page: 1
Go to End
Author Topic: 1536 Views
  • janulka
    Avatar
    Community Member
    80 Posts

    include does not work Link to this post

    Hello,

    I have file called Navig.ss in "Includes" folder, then I call it from Page.ss using <% include Navig %>, but it does not show up.

    It is perfectly ok when the full code is on Page.ss

    I am using "mysite" -> "templates" folder, with _config.php in mysite folder defining global $project; $project = 'mysite';

    btw $Layout works perfectly

    thanks for help

  • OscarGodson
    Avatar
    Community Member
    9 Posts

    Re: include does not work Link to this post

    Are you flushing your templates?

    e.g. mysite.com?flush=1

    Also, if that doesn't work, try that AND in Firefox do ctrl+shift+r or cmd+shift+r to clear the cache. In Safari try just clearing the cache.

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: include does not work Link to this post

    yep, that did it.. i should have thought about that.

    thanks a lot!

  • OscarGodson
    Avatar
    Community Member
    9 Posts

    Re: include does not work Link to this post

    The caching seems to always make things more time consuming then time saving. I wish there was a way to just turn it off as clients always seem to have trouble with it and loading times are so fast anyways.

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: include does not work Link to this post

    You can kinda' turn it off :

    put this line in your _config.php

    HTTP::set_cache_age(0);

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: include does not work Link to this post

    Includes do a lot of caching. So you will have to flush each and every time you update them.

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