i created a module that adds a custom attribute to categories i want the defualt behavior when i call the category collection with
Mage:getModel('catalog/category') to only return categories that have a specific value set for that custom attribute, how would I do this?
$collection = Mage::getModel('catalog/category')->getCollection()
You can call additional functions on that collection which will filter out the result:
Ofcourse you might also use the function chain like this:
Now to change the default behavior of
getCollection() you'd have to create a module that would have a model which rewrites the
Mage_Catalog_Model_Resource_Category, call a parent constructor in it and overwrite the
getCollection() function to add the attribute filter by default. The easy and not the right way would be to simply copy the files from core to local namepool and apply the required changes in there.