Good day all. Sometimes I've found some workarounds to satisfy some kind of needs that explain how to extend some core functionality by editing files like tools.php or frontendController.php. The last one I've found that saved my life, was a function to retrieve the name of a cms page starting from its id and the language id:
public static function getCMSTitle($id_cms,$id_lang){
$cms = new CMS($id_cms, $id_lang);
return $cms->meta_title;
}
<li><a href="{$link->getCMSLink(1)}">{Tools::getCMSTitle(1,$cookie->id_lang)}</a></li>
stackoverflow link
my question is:
Is it possible to think at these modifications in terms of modules? I mean, is possible to write a module that gives a functionality similar to this, so that expose a new method in all the pages and that can be called in tpl files?
and most important, it NOT alter the core code, so the shop remain upgradable, and the module could be upgraded as needed.