View Full Version : Mini Mods - Templates in files (useful for development)
cermi
02-11-2008, 10:00 PM
Hi devs/designers, did you get tired with modifying templates in vB admincp? I did, so I made this mod, which enables you to store files in [forum_root]/!templates/[tempate_name].html so you can edit them with your favourite HTML editor and you dont have to put them back into admincp after each edit.
Warning:
This mod is for dev purposes only and because the templates are compiled every time you reload the page, it slowes down the forums a bit (nothing significant on dev machine, but significant on production machine with many users).
Enjoy it and gimme feedback ;)
ChurchMedia
02-12-2008, 06:14 PM
Cool! I've been thinking that a mod that will export/import the individual templates at text files would be great, but this seems like it would be even better!
Just so I understand -- You enable this mod and work on the HTML files -- Then disable it so that VB will use the templates and NOT the HTML files -- Is that right?
Boofo
02-12-2008, 06:19 PM
Is there any way to modify this to store template as files only and not have them re-compiled? Chen did a hack way back in vb 3 something, I think, that stored the template as files just so you had a backup copy of them in case the forum went bye-bye somehow. More for archival purposes.
cermi
02-12-2008, 07:06 PM
Just so I understand -- You enable this mod and work on the HTML files -- Then disable it so that VB will use the templates and NOT the HTML files -- Is that right?
Yes, just don't forget to copy the content of the html files to vB templates in admincp otherwise your vB templates wouldn't be changed.
The idea of the mod is simple:
after loading the templates from database by vB, it reads all the files in the !template folder and rewrite the templates in $vbulletin->templatecache
Cool! I've been thinking that a mod that will export/import the individual templates at text files would be great, but this seems like it would be even better!
Yea, I might add this feature too (in future), so you won't have to make the initial database->files and final files->database copy. (But 2 copies are still better than copy after each change :) )
cermi
02-12-2008, 07:09 PM
Is there any way to modify this to store template as files only and not have them re-compiled? Chen did a hack way back in vb 3 something, I think, that stored the template as files just so you had a backup copy of them in case the forum went bye-bye somehow. More for archival purposes.
Well, you rewrite the template system, which wouldn't too difficult.
But for backup purposes you can use the standard vB export/import style feature, can't you?
Boofo
02-12-2008, 07:23 PM
I just want to back up the templates. All of them.
cermi
02-12-2008, 07:37 PM
I just want to back up the templates. All of them.
Or backuping the template table in db?
Boofo
02-12-2008, 07:41 PM
Ok, I can see where this is going. A simple "no" would have sufficed.
Is this working on 3.8.0
I have installed it, but I can't see any files or errors
nothing is happening at all :)
Sparky McSmith
04-03-2010, 10:21 PM
Wow. This is beautiful!!! Seriously. Great work Cermi - a simple, elegant solution to one of the biggest annoyances when customizing styles.
FYI - this works for vBulletin 4.0 just fine.
Thanks again!
bchertov
04-05-2010, 06:25 PM
Cermi,
Please test this on 4.0 and post it there too!
Thanks!
benaya
08-12-2010, 10:33 AM
Thanks man its working for vBulletin 4...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.