Problem With The Home Page Menu (frontpage) In A Template

Discussion in 'Joomla' started by trtrtrtr, Feb 18, 2013.

  1. #1
    Hello
    I have a problem with the home page menu (frontpage) in a template that I am designing. joomla 2.5 assigns featured articles to this item menu, where my front page contains (only modules). So articles will be displayed on the front page, while I need the articles to be displayed on other content types page (content single article template).I'll try to Explain:

    I tried to use this code to check for frontpage when I need to display my modules:
    
    $app = JFactory::getApplication();
     $menu = $app->getMenu();  
    if ($menu->getActive() == $menu->getDefault)
    {$frontpage = true;}
    
    Code (markup):
    using this I can get the frontpage, with my modules, but when an article title is clicked (any article) the frontpage will be displayed again because it is assigned by joomla to feature article, so I will find the clicked article content displayed as well as the front page.
     
    trtrtrtr, Feb 18, 2013 IP
  2. trtrtrtr

    trtrtrtr Greenhorn

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Ok, Some one had solved this issue a year ago, It is very simple but tricky,Just create a new menu item, assign it to any layout type other than featured, like (category-blog layout), then assign your articles to the new menu item.
    to read more about that here is the link:
    http://www.rockettheme.com/forum/index.php?f=15&t=162142&rb_v=viewtopic
     
    trtrtrtr, Feb 19, 2013 IP
  3. Rankx

    Rankx Active Member

    Messages:
    119
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    50
    #3
    The best thing to do is to extend the code.


    1. $app = JFactory::getApplication();
    2. $menu = $app->getMenu();
    3. if ($menu->getActive() == $menu->getDefault)
    4. {
      //Code for Home page
      }
      else
      {
      //Code for all other pages
      }
     
    Rankx, Mar 5, 2013 IP