Hi Team I am having a little issue trying to style the last item in my drop down menu? Actually I wish to style the last 2 items so that the menu doesn't go off screen on hover.(on small res monitors)
I have a custom theme for the auto block and I have the code below in dropdown.php
I have added this in : echo("<ul class='lastItem'>"); Line 35 so that I can style the class different ie move to left 200px. Now How I have done this applies the class to all the menu items not just the last 2?
Can any one help me out with the code I need to change?
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));$aBlocks=$controller->generateNav();$c= Page::getCurrentPage();$containsPages=false;$nh= Loader::helper('navigation');//this will create an array of parent cIDs $inspectC=$c;$selectedPathCIDs=array($inspectC->getCollectionID());$parentCIDnotZero=true;while($parentCIDnotZero){$cParentID=$inspectC->cParentID;if(!intval($cParentID)){$parentCIDnotZero=false;}else{
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));$aBlocks=$controller->generateNav();$c= Page::getCurrentPage();$containsPages=false;$nh= Loader::helper('navigation');//this will create an array of parent cIDs $inspectC=$c;$selectedPathCIDs=array($inspectC->getCollectionID());$parentCIDnotZero=true;while($parentCIDnotZero){$cParentID=$inspectC->cParentID;if(!intval($cParentID)){$parentCIDnotZero=false;}else{$selectedPathCIDs[]=$cParentID;$inspectC=Page::getById($cParentID);}}foreach($aBlocksas$ni){$_c=$ni->getCollectionObject();if(!$_c->getCollectionAttributeValue('exclude_nav')){if(!$containsPages){// this is the first time we've entered the loop so we print out the UL tagecho("<ul class=\"nav\">");}$containsPages=true;$thisLevel=$ni->getLevel();if($thisLevel>$lastLevel){echo("<ul class='lastItem'>");}elseif($thisLevel<$lastLevel){for($j=$thisLevel;$j<$lastLevel;$j++){if($lastLevel-$j>1){echo("</li></ul>");}else{echo("</li></ul></li>");}}}elseif($i>0){echo("</li>");}$pageLink=false;if($_c->getCollectionAttributeValue('replace_link_with_first_in_nav')){$subPage=$_c->getFirstChild();if($subPage instanceof Page){$pageLink=$nh->getLinkToCollection($subPage);}}if(!$pageLink){$pageLink=$ni->getURL();}if($c->getCollectionID()==$_c->getCollectionID()){echo('<li class="nav-selected nav-path-selected"><a class="nav-selected nav-path-selected" href="'.$pageLink.'">'.$ni->getName().'</a>');}elseif(in_array($_c->getCollectionID(),$selectedPathCIDs)&&$_c->getCollectionID()!=1){echo('<li class="nav-path-selected"><a class="nav-path-selected" href="'.$pageLink.'">'.$ni->getName().'</a>');}else{echo('<li><a href="'.$pageLink.'">'.$ni->getName().'</a>');}$lastLevel=$thisLevel;$i++;}}$thisLevel=0;if($containsPages){for($i=$thisLevel;$i<=$lastLevel;$i++){echo("</li></ul>");}}?>
Code
Post Reply
Delete Post
You are allowed to delete your post for 5 minutes after it's posted.
This website stores cookies on your computer. These cookies are used to improve
your website experience and provide more personalized services to you, both on this website and through
other media. To find out more about the cookies we use, see our Privacy Policy.