0
Welcome Guest! Login
0 items Join Now

Novus Template - Converting to J2.5

    • kmedri's Avatar
    • kmedri
    • Rocketeer
    • Posts: 66
    • Thanks: 0

    Novus Template - Converting to J2.5

    Posted 11 years 1 month ago
    • I am trying to convert the Novus template to be compatible with J2.5. I have made some progress however I am stuck on the top horizontal menu menu. I cannot get it to show. I can see the menu options in the backend and make the correct choices.

      The url of the site:

      http://ostomy.medri.co.nz/jupgrade/

      This is the default.php file in the html/mod_mainmenu:
      <?php
      
      // no direct access
      defined('_JEXEC') or die;
      
      
      if ( ! defined('modMainMenuXMLCallbackDefined') )
      {
      function modMainMenuXMLCallback(&$node, $args)
      {
      	$user	= &JFactory::getUser();
      	$menu	= &JSite::getMenu();
      	$active	= $menu->getActive();
      	$path	= isset($active) ? array_reverse($active->tree) : null;
      
      	if (($args['end']) && ($node->attributes('level') >= $args['end']))
      	{
      		$children = &$node->children();
      		foreach ($node->children() as $child)
      		{
      			if ($child->name() == 'ul') {
      				$node->removeChild($child);
      			}
      		}
      	}
      
      	if ($node->name() == 'ul') {
      		foreach ($node->children() as $child)
      		{
      			if ($child->attributes('access') > $user->get('aid', 0)) {
      				$node->removeChild($child);
      			}
      		}
      	}
      
      	if (($node->name() == 'li') && isset($node->ul)) {
      		$node->addAttribute('class', 'parent');
      		$children = $node->children();
      		if ($node->attributes('level') == 1) {
      			if ($children[0]->name() == 'a' or $children[0]->name() == 'span') {
      				$children[0]->addAttribute('class', 'topdaddy');
      			}
      		} else {
      			if ($children[0]->name() == 'a' or $children[0]->name() == 'span') {
      				$children[0]->addAttribute('class', 'daddy');
      			}
      		}
      		
      	}
      
      	if (isset($path) && in_array($node->attributes('id'), $path))
      	{
      		if ($node->attributes('class')) {
      			$node->addAttribute('class', $node->attributes('class').' active');
      		} else {
      			$node->addAttribute('class', 'active');
      		}
      	}
      	else
      	{
      		if (isset($args['children']) && !$args['children'])
      		{
      			$children = $node->children();
      			foreach ($node->children() as $child)
      			{
      				if ($child->name() == 'ul') {
      					$node->removeChild($child);
      				}
      			}
      		}
      	}
      
      	if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
      		if ($node->attributes('class')) {
      			$node->addAttribute('class', $node->attributes('class').' item'.$id);
      		} else {
      			$node->addAttribute('class', 'item'.$id);
      		}
      	}
      
      	if (isset($path) && $node->attributes('id') == $path[0]) {
      		$node->addAttribute('id', 'current');
      	} else {
      		$node->removeAttribute('id');
      	}
      	$node->removeAttribute('level');
      	$node->removeAttribute('access');
      }
      	define('modMainMenuXMLCallbackDefined', true);
      }
      
      modMainMenuHelper::render($params, 'modMainMenuXMLCallback');
      
      This is the rt_utils.php code in the template root:

      <?php
      defined( '_JEXEC' ) or die( 'Restricted index access' );
      
      global $Itemid;
      
      // menu code
      $document	= &JFactory::getDocument();
      $renderer	= $document->loadRenderer( 'module' );
      $options	 = array( 'style' => "raw" );
      $module	 = JModuleHelper::getModule( 'mod_mainmenu' );
      $mainnav = false; $subnav = false;
      if($mtype == "splitmenu") : 
      	$module->params	= "menutype=$menu_name\nstartLevel=0\nendLevel=1";
      	$mainnav = $renderer->render( $module, $options );
      	$module	 = JModuleHelper::getModule( 'mod_mainmenu' );
      	$module->params	= "menutype=$menu_name\nstartLevel=1\nendLevel=9";
      	$options	 = array( 'style' => "rounded");
      	$subnav = $renderer->render( $module, $options );
      elseif($mtype == "suckerfish") : 								      	
      	$module->params	= "menutype=$menu_name\nshowAllChildren=1";
      	$mainnav = $renderer->render( $module, $options );
      endif;
      
      // make sure subnav is empty
      if (strlen($subnav) < 10) $subnav = false;
      //Are we in edit mode
      $editmode = false;
      if (JRequest::getCmd('task') == 'edit' ) :
      	$editmode = true;
      endif;
      
      $topmod_count = ($this->countModules('user1')>0) + ($this->countModules('user2')>0);
      $topmod_width = $topmod_count > 0 ? ' w' . floor(99 / $topmod_count) : '';
      $bottommod_count = ($this->countModules('user3')>0) + ($this->countModules('user4')>0);
      $bottommod_width = $bottommod_count > 0 ? ' w' . floor(99 / $bottommod_count) : '';
      $footermod_count = ($this->countModules('user5')>0) + ($this->countModules('user6')>0) + ($this->countModules('user7')>0);
      $footermod_width = $footermod_count > 0 ? ' w' . floor(99 / $footermod_count) : '';
      
      $side_column = ($this->countModules('left')>0 or $subnav) ? $side_column : "0";
      
      if ($template_width=="fluid") { 
      	$template_width = "width: 95%;margin: 0 auto";
      } else {
      	$template_width = 'margin: 0 auto; width: ' . $template_width . 'px;';
      }
      
      function isIe6() {
      	$agent=$_SERVER['HTTP_USER_AGENT'];
      	if (stristr($agent, 'msie 6')) return true;
      	return false;
      }
      
      ?>

      Many thanks for any help
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: Novus Template - Converting to J2.5

    Posted 11 years 1 month ago
    • I am afraid that this kind of support can't be provided here in the free support forum
    • Check my services at: Mihha-Vision
    • kmedri's Avatar
    • kmedri
    • Rocketeer
    • Posts: 66
    • Thanks: 0

    Re: Novus Template - Converting to J2.5

    Posted 11 years 1 month ago
    • Hi Igor,
      this is the forum for the free novus template. Why cant i ask other template users for help.

      I managed to get around the issue by removing the menu php from the index.php file and adding a new menu module to the tooltip position.
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: Novus Template - Converting to J2.5

    Posted 11 years 1 month ago
    • I am afraid that you didn't understand me well or I didn't explain it well. I didn't say that you can't ask questions here. I just said that unfortunately, RT mods can't provide coding support regarding this here. You are, by all means, free to ask questions and hopefully receive the answer from other members
    • Check my services at: Mihha-Vision

Time to create page: 0.078 seconds