21286 Posts in 5733 Topics by 2602 members
| Go to End | Next > | |
| Author | Topic: | 1653 Views |
-
changing templates not changing site...

15 January 2011 at 11:43pm Last edited: 16 January 2011 1:49am
Am sure this is a basic problem that is very easy to understand and get working but I am in stupid mode. Basically - I am changing elements of my templates but they are not changing in my front end pages? Can anyone tell me why?
Many thanks
nb: have cleared cache as well as history etc of browser and rebuilt db but nothing changes - even if i check it in a browser that has not seen the site yet it seems to be pulling the content info from somewhere else
BTW - the info that i am changing is static footer info.
-
Re: changing templates not changing site...

16 January 2011 at 1:55am
Just to clarify how you clear the cache... I create a silverstripe-cache folder in the webroot and I delete the entire contents... this is my way of clearing the cache because a dev/build?flush=all doesn't clear templates with nested includes.
-
Re: changing templates not changing site...

16 January 2011 at 2:03am
Thanks swaiba
I kind of fixed it - as unexplained as it appears - i deleted the <% include Footer %> element from my page.ss, saved and refreshed the page in the browser then popped it back in and low and behold it re-appeared with my changes there. (FYI) I cleared the cache via the default "clear recent history" (i am testing in FF). Thanks for the advice - will try your method on my next change if the problem persists
PS: Am still wrestling with the MAMP problem we discussed a few days ago - thanks for your help there too ;)
-
Re: changing templates not changing site...

16 January 2011 at 3:27am
Whenever you make changes to your templates (especially includes) you should append ?flush to the url of the page you made changes to.
This is because SS caches the templates as raw PHP and the ?flush flag tells SS to re-parse the templates.
-
Re: changing templates not changing site...

27 January 2011 at 10:27am
Changes to my Includes/Header.ss weren't working and doing the above still didn't clear the cache. This worked:
1 - copying to my desktop then removing the entire Includes folder from the server
2 - running /dev/build?flush=all
3 - manually removing all the files in the silverstripe-cache folder
4 - visiting the home page of the site with ?flush=1
5 - copying from the desktop to the server the entire Includes folder
6 - running /dev/build?flush=all
7 - manually removing all the files in the silverstripe-cache folder
8 - visiting the home page of the site with ?flush=1I hadn't made changes to the SS files for several months, and it was a surprise to run into this issue where my simple change didn't get picked up. However, before I made my change to the Header.ss, I did a "duplicate" of the templates folder with my ftp client. Right after doing that my ftp client could not do a chmod to the templates folder, displaying an infrequent error the folder could not be found. Perhaps my ftp client changed a permission or something like that to mess things up.
SS is great. After hundreds of hours with Drupal and Joomla, SS is sane and has a great community. Thank you.
-
Re: changing templates not changing site...

27 January 2011 at 11:48am
Just to note - you shouldn't need to do a full /dev/build?flush=all just for template changes as that is designed to rebuild your database. Simply doing a ?flush=all should work fine.
-
Re: changing templates not changing site...

16 August 2011 at 9:21am
This was driving me mad but the ?flush at the end of the url did the trick. Like:
http://localhost/?flush
in the case of the home page.Dev mode should mean dev mode, no cache, not anywhere not ever.
-
Re: changing templates not changing site...

17 August 2011 at 6:33pm
if (Director::isDev()) {
SSViewer::flush_template_cache();
}
| 1653 Views | ||
| Go to Top | Next > |





