content management system - How to get list of cms pages based on a particular theme in magento? -


i have created cms pages 2 themes of single store view.
want show cms pages links in front end specific theme.
i.e. cms page links should come used in particular theme.
have used below function extract cms pages..

public function getcmspages(){  $storeid = $this->helper('core')->getstoreid(); $cms = mage::getmodel('cms/page')->getcollection()                 ->addfieldtofilter('is_active',1)                 ->addstorefilter($storeid); $url = mage::getbaseurl(); $html = ""; foreach($cms $cmspage):     $page = $cmspage->getdata();         if($page['identifier'] == "no-route" || $page['identifier'] == "enable-cookies" || $page['identifier'] == "empty"){          /* nothing */      } else {         if($page['identifier'] == "home"){             $html .= "<li><a href=\"$url\" title=\"".$page['title']."\">".$page['title']."</a></li>\n";         } else {             $html .= "<li><a href=\"$url".$page['identifier']."\" title=\"".$page['title']."\">".$page['title']."</a></li>\n";         }     } endforeach;  return $html;    }    

how can get cms pages particular theme ?

you can add theme filter custom_theme on field

$storeid = $this->helper('core')->getstoreid(); $cms = mage::getmodel('cms/page')->getcollection()                 ->addfieldtofilter('is_active',1)                 ->addfieldtofilter('custom_theme','default/default')                 ->addstorefilter($storeid); 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -