Skip to content

Instantly share code, notes, and snippets.

@ceckoslab
Created August 27, 2012 19:45
Show Gist options
  • Save ceckoslab/3491692 to your computer and use it in GitHub Desktop.
Save ceckoslab/3491692 to your computer and use it in GitHub Desktop.
<?php
/* CMS Tabs */
$menuIdentifiers = Mage::getModel('core/variable')
->setStoreId(Mage::app()->getStore()->getId())
->loadByCode('top_cms_menu')->getValue('text');
$menuIdentifiersArray = explode(',', $menuIdentifiers);
$currentPageIdentifier = Mage::getBlockSingleton('cms/page')->getPage()->getIdentifier();
$collection = Mage::getModel('cms/page')->getCollection();
$collection->addFieldToFilter('identifier', array('in' => $menuIdentifiersArray));
$collection->addFieldToFilter('is_active', 1);
$collection->getSelect()->order("find_in_set(identifier,'".implode(',',$menuIdentifiersArray)."')");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment