Magento – How to get the custom attribute values in the catalog category list block

blockscatalogcategorycustom

I have added a custom attribute to my category.
On category product listing page i want to retrieve the values of that custom attribute.
When i got Mage/Catalog/Block/Product/List.php i can find this protected function _getProductCollection() function. Is this function that is getting the collection from the db?
If yes how to get my custom attribute values in that method?

Or else which is the method that is responsible for getting collection from db and how to get the attribute value in that method?

EDIT:
The purpose is to add some more skus to that collection based on the custom attribute value

Best Answer

Product Attribute

Just add it to this xpath:

/config/frontend/product/collection/attributes

You can find an example here:

/app/code/core/Mage/Catalog/etc/config.xml:718

Category Attribute

Just add it to this xpath:

/config/frontend/category/collection/attributes

You can find an example here:

/app/code/core/Mage/Catalog/etc/config.xml:742