li class active

Post Reply
User avatar
amr
Master Bludit
Posts: 56
Joined: Fri Apr 22, 2016 8:36 am
Location: Egypt
Contact:

how to set class active in <li>
User avatar
amr
Master Bludit
Posts: 56
Joined: Fri Apr 22, 2016 8:36 am
Location: Egypt
Contact:

Code: Select all

<?php
				$html = '<li><a'.( ($Url->whereAmI()=='home')?' class="active"':'').' href="'.$Site->homeLink().'">'.$Language->get('Home').'</a></li>';
				$parents = $pagesParents[NO_PARENT_CHAR];
				foreach($parents as $parent)
				{
					// Check if the parent is published
					if( $parent->published() )
					{
						// Print the parent
						$html .= '<li>';
						$html .= '<a'.( ($parent->key()==$Url->slug())?' class="active"':'').' href="'.$parent->permalink().'">'.$parent->title().'</a>';
		
						
					}
				}
				
				
				echo $html;
				// OPTIONAL LOGIN BUTTON
			?>

why its not working ? :!: :!:
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

What is your CSS? Can you please give a link to the installation.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
amr
Master Bludit
Posts: 56
Joined: Fri Apr 22, 2016 8:36 am
Location: Egypt
Contact:

custom css template.
its working if i am running in html format without adding any of bludit contents
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Which theme?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
amr
Master Bludit
Posts: 56
Joined: Fri Apr 22, 2016 8:36 am
Location: Egypt
Contact:

User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

This is not (yet) a Bludit theme. You have to adapt it. ;-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply