Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Changes to Includes/*.ss templates not reflected in front end after rebuild

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 2627 Views
  • cadabramarketing
    Avatar
    Community Member
    5 Posts

    Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    Hi All,

    I am using my own theme, with own Page sub-classes and modified Includes, such as Navigation.ss.

    Changes made to .ss templates in the Includes folder are not reflected in the front end (after running GET /dev/build?flush=1 several times, cleaning / disabling browser cache, etc.). I don't use server-side caching, SilverStripe or another, either.

    I am running SilverStripe 2.4.0 with MySQL on Ubuntu 8.4.0.

    Any ideas ?

    Many thanks in advance,

    Jerzy

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    You could always try (*cringes*) deleting the "<% include include.ss %>" bit , viewing the page (item should not be there!), add back in the "<% include include.ss %>" back in... that will tell you 100% if what you are doing is working... but it ain't pretty!

    Barry

  • cadabramarketing
    Avatar
    Community Member
    5 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    Hi Barry,

    Thanks a lot for your suggestion.

    I actually tried it before my original posting, but to no avail.

    However, I seem to have found a workaround: when I upload the entire Templates folder (which contains the Includes folder, which in turn contains my changed Navigation.ss file) SilverStripe recognizes the change and takes it into account during the rebuild, and I do see the change in the front end. Note: this is not the case when I upload the Includes folder only - it has to be one level higher (the entire Templates folder)!

    I did several tests and they seem to confirm this rule.

    Now I investigated a little trying to understand the mechanism and here's the only conclusion I could find:

    It seems SilverStripe is checking for changes to the files in the Templates folder (or specifically Page.ss if you use the standard theme - in this case Page.ss is the only file there)! If the content of the Templates folder appears unchanged (and that's the case, at least under Linux, when you update a file deeper in the folder's tree) then SilverStripe stops checking for changes, instead of doing a recursive lookup throughout the entire Templates tree...

    Weird but that's the only explanation I can see.

    Cheers,

    Jerzy

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    I'm having the exact same issue here. Any changes I make to the includes/SideBar file are noting being reflected in the front end. Is there anyway to force silverstripe to recheck. (The above method by cadabramarketing isn't very convenient!) I've obviously done a rebuild also.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    add a silverstripe-cache folder to your root (alongside cms and sapphire)
    you can now delete it's contents (which is the cache) and force a complete rebuild

    I am recommending this very often nested included templates...

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    Hey Swabia, sorry to bring this up again but your comment above doesn't make sense to me. It sounds like you are saying create a cache folder then delete the cache on your browser then do a dev/build? This has no effect for me for updating the Include files. I encounter this issue time and time again and it is becoming very frustrating.

    Clarification would be appreciated.

    Thanks

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    1)add a silverstripe-cache folder to your root (alongside cms and sapphire)

    if on your server directory might be called something like...
    /public_html/silverstripe-cache
    if on a windows machine...
    C:\wamp\www\aoa\silverstripe-cache

    2)you can now delete it's contents (which is the cache) and force a complete rebuild

    this means goto the folder you created before "silverstripe-cache" and delete the entire contents of the directory (i.e. the cache that silverstripe is creating server side) - nothing to do with browser cache!
    (of course after creating the folder it will be empty - but when you browse a page silverstripe will use the folder to hold the cache - then when you change stuff you can delete and silverstripe will recreate)

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Changes to Includes/*.ss templates not reflected in front end after rebuild Link to this post

    Ahh. Thanks. I was just adding a folder called cache. Not silverstripe-cache. I'll give this a whirl! Cheers.

    2627 Views
Page: 1 2
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.