Advertisement
oscarholmedo

Joomla 3 force load custom layout on frontpage

Mar 29th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. /****************************************************************************/
  2. /* Problem: Custom layout not loads if a single article is set on frontpage */
  3. /* Fix on file /components/com_content/views/article/view.html.php          */
  4. /* Search this comment:                             */
  5. /* // Load layout from active query (in case it is an alternative menu item)*/  
  6. /* Insert this:                                 */
  7.  
  8. $option = $app->input->getCmd('option', '');
  9. $view   = $app->input->getCmd('view', '');
  10. $menu   = $app->getMenu();
  11.  
  12. if ($menu->getActive() == $menu->getDefault() && ($option=='com_content' && $view=='article')) {
  13.     $this->setLayout('customlayoutname');
  14. }
  15.  
  16. /* Done now it forces to load your custom layout                */
  17. /****************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement