Famous question on templates.dat

Hi,

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!

Hi Raghulan,

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…

FLBuilderModel::save_template
FLBuilderModel::update_template
FLBuilderModel::get_template
FLBuilderModel::apply_template

Justin

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

Hey David,

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…

http://forum.wpbeaverbuilder.com/its-now-easier-than-ever-to-work-with-beaver-builder-templates/

Let me know if you have any questions about that.

Justin