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
(),itonly given 1 item,
you need toremove this function
and addgetAllIds
() function on this collection.Full code:
getAllIds() give all ids in an array.