Las clases activas ya no se asignan (PHP) después de la migración de Joomla 3.3.0 / Actualización de PHP 5.4.29
Frecuentes
Visto 110 equipos
0
I just migrated to Joomla! 3.3.1, and my active menu classes are no longer working:
<ul>
<li><a href="index.php" <?php if($ItemId == '1'){echo 'class="active"';}?>><span>Home</span></a></li>
<li><a href="index.php?option=com_content&view=article&id=2&Itemid=2" <?php if($ItemId == '2'){echo 'class="active"';}?>><span>About The Practice</span></a></li>
<li><a href="index.php?option=com_content&view=article&id=3&Itemid=3" <?php if($ItemId == '3'){echo 'class="active"';}?>><span>Our Doctors & Providers</span></a></li>
</ul>
I also had to update the site to PHP version 5.4.29, I'm not sure what has the bigger influence here. As mentioned, before the migration the menu classes were being assigned as desired. Now, no menu classes are being assigned at all. I have already had to make some tweaks to account for conflicts that the migration caused (i.e. changing "$"s to "jQuery"s). I'm pretty novice with PHP.
The $ItemId is set as follows:
$ItemId = isset($_GET['Itemid'])?$_GET['Itemid']:'';
Why are you using jQuery 1.2.6? Joomla gets shipped with more or less the latest version of jQuery so why don't you use that? Can you also show the code you're using to define the
$ItemId
¿variable? - LodderHave you got PHP errors turned on? Is there any clues in the PHP Error log? - RiggsFolly
I've never used the error reporting before so I just looked it up. I changed Error Reporting in the Joomla! Administrator panel to "Development", then I went and looked at the Console in Firefox and an unrelated error came up (I fixed it). Now it's blank? As implied, I'm not sure if I'm checking this correctly... - ilostmyslipper
Migrated from what version? - Elin
I migrated step-by-step all the way from 1.5. However, everything was still perfect at 2.5.20. So this problem only occurred in the migration phase between 2.5.20 to 3.3.0. - ilostmyslipper