0

I have two themes (desktop and iphone) for same store view.
I have created cms pages for both the themes differently due to different look.
so there are 2 about-us pages, 2 contact-us pages..and so on..

Now there is a link called "sitemap" in which all the links of cms pages and categories is showing.
The problem is..
both the links of cms pages are displaying.

The function resoponsible for getting cms pages is as follows..

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 as $cmspage):
        $page = $cmspage->getData();    
        if($page['identifier'] == "no-route" || $page['identifier'] == "enable-cookies" || $page['identifier'] == "empty"){
             /* do 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;   
}   

Now What I want is..
How can I get theme specific cms page links in the frontend ?

2
  • you can get the cms page according to the url key of that particular page Mar 4, 2016 at 4:52
  • @Manashvibirla, I have to show all the links in the front end. Because I have created 2 pages for same cms (1 for desktop, 1 for iphone). So it is showing both the links. Mar 4, 2016 at 4:55

1 Answer 1

0

You have to create a same name CMS page.

Then got to that CMS page .

GOTO Page-> Design -> Custom Design -> Select Your Theme .
4
  • hi @HiteshVaghasiya, same name refers to same "URL Key" or "page title" ? Mar 4, 2016 at 4:37
  • @Kishore Yes , "URL Key" or "page title" are same and content as you want but just you have to set only theme . Mar 4, 2016 at 4:42
  • "A page URL key for specified store already exists." error coming while creating with same url key. Mar 4, 2016 at 4:45
  • I Thinks this link help you. stackoverflow.com/questions/19348589/… Mar 4, 2016 at 5:18

Your Answer

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

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