Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 01:35 am EST
Geeklog Forums
Simplifying theme mods
jmucchiello
Easier Theme Upgrades (Core & Custom theme file separation)
Along the lines of lib-custom.php, which separates custom code from core files, all themes should have a "custom" or "local" folder in each theme directory where edited copies of theme files are kept, and used from preferentially, if present. This minimizes the effort of having a laundry list of backup files, or doing a diff with old template files each time you realize that the theme has to be upgraded.
With this format, one downloads the latest core theme (say professional) with all the right admin files etc, and just copy over the custom directory from older versions.
1. Is it going to stop one from having to redo style.css, header.thtml and other usual suspects with files from the new template? - Probably not.
2. Does it make sure you have all the latest admin templates? Yes.
3. Does it make changes more traceable when multiple admins are changing templates? Yes.
4. Does it make theme development easier? Perhaps.
(There seem to be quite a few theme updates with recent versions - I recently gave up on a custom theme - a hacked GL1.3.6 version of aeon - and ended up modding the latest professional theme because upgrading the old theme seemed too daunting).
Here's my idea for a fix: modify the template class in system/classes/template.class.php.
if ($this->debug & 4) {
echo "<p><b>filename:</b> filename = $filename</p>\n";
}
// this is new
if (file_exists($this->root . "/custom/$filename")) {
return $this->root . "/custom/$filename";
}
// end of new
if (substr($filename, 0, 1) != "/") {
$filename = $this->root."/".$filename;
}
if (!file_exists($filename)) {
$this->halt("filename: file $filename does not exist.");
}
return $filename;
}
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content