Collection – Get All Item-IDs from a Collection in Magento

cms-blockcollection;getmodel

I found out how to get the first item from a collection:

$pageId = Mage::getModel('cms/page')->getCollection()
          ->addFieldToFilter('identifier', 'your name in the pages')
          ->getFirstItem()
          ->getId();

But now I have 3 IDs with the same name but different store views.
How can I get these item-Ids?
When I write that statement above without "getFirstItem()" and/or without "getId()" then Magento throws me an error.

Best Answer

Tipo,as you want using getFirstItem(),it only given 1 item,you need to remove this function and add getAllIds() function on this collection.

Full code:

$pageIds = Mage::getModel('cms/page')->getCollection()
          ->addFieldToFilter('identifier', 'your name in the pages')
          //->getFirstItem()
          ->getAllIds();)

getAllIds() give all ids in an array.