Modyfying current slider system to make it a little bit more autonomous as in it's original form I must manually remove code from list if specific products is already gone or promotion is over so I added additional attribute into table "is_slider", "start_date" and "end_date" but my collection does not work. What I've done wrong ?

    $collection = Mage::getModel('cms/block')->getCollection()
      ->addFieldToFilter('is_slider', '1')

Of course this code should select only ids where "is_slider" is true, regardless what date is but it is not important for now.

How to get only those Ids where "is_slider" = true?

OMG I'm blind ...... Yes of course it does work after I changed it from "page" to "block"

1 Answer 1


You are using Mage::getModel('cms/page') CMS Pages model.

Use Mage::getModel('cms/block') Static block model.

  • Thank you Pankaj, silly me, how could I not see this ? Thank you
    – Rob D. A.
    Commented Feb 22, 2018 at 14:33
  • Glad it worked for you. please accept the answer so that it will helpful for others Commented Feb 22, 2018 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.