Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 616025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:16:58+00:00 2026-05-13T18:16:58+00:00

I wonder how to check that a particular CMS block is active or not.

  • 0

I wonder how to check that a particular CMS block is active or not.

So far I have found that CMS block are Mage_Cms_Block_Block class that inherits from Mage_Cms_Block_Abstract class

Mage::log(get_class(Mage::app()->getLayout()->createBlock(‘cms/block’)->setBlockId(‘promo_space’)

Neither of the two classes have methods that would check wether the block is active or not. How do I do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:16:58+00:00Added an answer on May 13, 2026 at 6:16 pm

    Got this myself

    I created a method isActive(Identifiere, Value) in helper “Block” in the Mage/Cms local Module.

    This is how the method looks

    public function isActive($attribute, $value){
    
        $col = Mage::getModel('cms/block')->getCollection();
        $col->addFieldToFilter($attribute, $value);
        $item = $col->getFirstItem();
        $id = $item->getData('is_active');
    
        if($id == 1){
            return true;
        }else{
            return false;
        }
    
    }
    

    parameter $attribute is table(cms-block) field such as ‘identifier’ or ‘title’ and value can be the name of the static block or identifier itself. Both used to filter down the particular static block you are interested in

    Here is how i call the helper

    if(Mage::helper('cms/block')->isActive('identifier','promo_space')){
    //do that
    }
    

    I have also updated the config.xml file for Cms block to read my new helper and the method.

    I hope its useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if I can just check something that I have not tried before,
I wonder whether someone could help me please, From a tutorial I found online
I always wonder why to check (i)if a field is not empty and also
I wonder If it is possible to have fixed number of buttons that is
I have an app that is slowly being upgraded to MVC (MVC.net?) from ASP.net.
Possible Duplicate: Conditional Check in Where clause I have a few parameters that I
When I use file functions in PHP, I check for EOF. I wonder if
wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td>
wonder whether someone can help me with the following one... I have a struct
wonder if someone could help me with a little problem. I have session values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.