I noticed that all the default templates / layouts are stored in /data/templates.dat as a php serialized object arrays. I needed to change some texts and images. So i unserialized the dat file as a Json file, Replaced all the texts, Next i again serialized back to templates.dat.
Now, When i click the “templates” link in the top, i got a popup and the templates are loaded. But when i click the template, Nothing happens just “Drop a row layout or module to get started!” Message.
After going through the codes
$templates = self::get_templates();
$templates returns valid array.
$template->nodes also returns valid array.
So my recreated templates.dat is correct (I could unserialize and print_r the contents)
Are you using any special tool for serializing templates.dat?
I need help here, I know that the .dat file will get overwritten in next update, so i won’t update. Thanks in advance!
What you’re doing sounds like it should work. We don’t currently support changing core templates (we will be releasing an interface for that in the future) so you might do a bit more digging to see if you can get it to work.
Core templates are serialized in the FLBuilderModel::save_templates method. I’d also have a look at these methods to see if you can find out why it might not be working…
Has there been any update on this? in terms of overriding or replacing the default Home page and Content page templates? I would like to change the images of those templates or even add to those categories with my own. Thanks
There’s currently no easy way to do it with code, but the Agency version does have settings for overriding the built-in templates with your own on a per-site basis. You can read more about that in this blog post…
Let me know if you have any questions about that.