In joomla i want a extra value with the subfix here is the code $menuclass = 'mainlevel' . $params->get('class_sfx'); it will print class ="mainlevel-main-nav" but i want mainlevel-main-nav1 mainlevel-main-nav2 mainlevel-main-nav3 and so on... but its cant doing here is the code what is for $water..... $menuclass = 'mainlevel' . $params->get('class_sfx').$water;
$navcount = 1; $menuclass = 'mainlevel' . $params->get('class_sfx').$navcount; //for (something <= value) { //$navcount++; // $menuclass = 'mainlevel' . $params->get('class_sfx').$navcount; //} Code (markup): Loop something like this should work!!!
got the following error Parse error: syntax error, unexpected ')', expecting ';' in C:\wamp\www\xxxxx-2.com\modules\mod_mainmenu\legacy.php on line 113 :M
You should have more "arguments" in your for loop: <?php for($navcount = 1; $navcount <= $value;$navcount++){ $menuclass = 'mainlevel' . $params->get('class_sfx').$navcount; } ?> PHP: Is a way to do it, or: <?php $navcount = 1; while($navcount <= $value){ $menuclass = 'mainlevel' . $params->get('class_sfx').$navcount; $navcount++; } ?> PHP:
now nothing printing class="" <a href="/xxxxxxx-2.com/index.php?option=com_content&view=article&id=1&Itemid=2" class="">about us</a>
if (strcasecmp(substr($mitem->link, 0, 4), 'http')) { $mitem->url = JRoute::_($mitem->link, true, $menu_secure); } else { $mitem->url = $mitem->link; } $menuclass = 'mainlevel' . $params->get('class_sfx'); if ($level > 0) { $menuclass = 'sublevel' . $params->get('class_sfx'); } // replace & with amp; for xhtml compliance // remove slashes from excaped characters $mitem->name = stripslashes(htmlspecialchars($mitem->name)); this is the original code
You did actually change $value to what you what didn't you? Wherever I have $value in my script, put it as 10, 100, 3000 or whatever number you want.