Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

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


Go to End


10 Posts   4697 Views

Avatar
cadabramarketing

Community Member, 5 Posts

3 June 2010 at 4:12am

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

Avatar
swaiba

Forum Moderator, 1899 Posts

3 June 2010 at 5:07am

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

Avatar
cadabramarketing

Community Member, 5 Posts

3 June 2010 at 7:38am

Edited: 11/06/2010 10:38am

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

Avatar
MagicUK

Community Member, 60 Posts

25 January 2011 at 1:34am

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.

Avatar
swaiba

Forum Moderator, 1899 Posts

25 January 2011 at 1:46am

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

Avatar
MagicUK

Community Member, 60 Posts

3 February 2011 at 1:14am

Edited: 03/02/2011 1:15am

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

Avatar
swaiba

Forum Moderator, 1899 Posts

3 February 2011 at 1:24am

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)

Avatar
MagicUK

Community Member, 60 Posts

3 February 2011 at 1:39am

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

Go to Top