joomla3.1 - joomla override model for mod_banners -


i'm using joomla 3.1 , i'm using template hacks override mod_banners -

/mytemplate/html/mod_banners/default.php 

which working fine.

however, banners module calls file:

/components/com_banners/models/banners.php 

which can't seem override. i've tried moving file (and folders) /mytemplate/html folder, doesn't work.

i've tried putting following code banners default.php file:

jmodellegacy::addincludepath(jpath_root.'/templates/home/com_banners/models/', 'bannersmodel'); $model      = jmodellegacy::getinstance('banners', 'bannersmodel', array('ignore_request' => true)); $banners    = $model->getitems(); 

but doesn't work either. there way can override query in /com_banners/models/banners.php without changing core files?

all i'm trying pull in descriptions each banner, without changing core.

thanks in advance!

the way override model in joomla make own version of original, , load (register) through system plugin, before model accessed first time. use case, way complicated.

even if not practice, since breaks mvc structure, i'd fetch data within template.

$db    = jfactory::getdbo(); $query = $db->getquery(true); $query->select('id, name, description')       ->from('#__banners'); $db->setquery($query); $banners = $db->loadobjectlist(); 

now can access banner descriptions, fx. in loop:

foreach ($banners $banner) {     echo $banner->id, ': ', $banner->description; } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -