Zii Cmenu Not Working When Clicked On An Element

Hi, I’m trying to build a custome theme/layout for my application. All was going pretty well until i faced an issue with zii.widgets.CMenu. The menu is being rendered properly but when i click on the menu items nothing happens. I’m not being redirected to the specific link location.

Here is the custom navigation that i’m using for the Menu.


<!-- Header -->

<!-- Header -->

<header>

    <div class="sticky-nav">

        <a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>


        <div id="logo">

            <a id="goUp" href="#home-slider" title="Easy Aesthetics">Easy Aesthetics</a>

        </div>


        <nav id="menu">

           <!-- <ul id="menu-nav">

                <li class="current"><a href="#home-slider">Home</a></li>

                <li><a href="#">Supplement Products</a></li>

                <li><a href="#work">Training</a></li>

                <li><a href="#about">Nutrition Guide</a></li>

                <li><a href="#contact">Affiliates</a></li>                        

                <li><a href="#" class="external">About Us</a></li>

            </ul>-->

                <?php $this->widget('zii.widgets.CMenu',array(

                        'id'=>'menu-nav',

                        'encodeLabel'=>false,

			'items'=>array(

				array('label'=>'Home', 'url'=>array('/')),

				array('label'=>'Supplement Products', 'url'=>array('/products')),

				array('label'=>'Training', 'url'=>array('/site/contact')),

                                array('label'=>'Nutrition Guide', 'url'=>array('/site/contact')),

                                array('label'=>'Affiliates', 'url'=>array('/site/contact')),

				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),

				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

			),

		)); ?>

            

        </nav> 





    </div>

</header>


<!-- End Header -->

I just can’t figure out why the menu isn’t clickable. Please provide any sort of tips on how to solve this problem.

Thanks,

Maxx

So can anyone please help me out with this. I’m stuck endlessly with this issue. Like i mentioned above, nothing happens when i click on the menu items. I just don’t know where i went wrong.

Your controller file is protectd root folder or module folder? please check the put on double slash


//site/index

or romove the slash


site/index

i think your path was not right calling a controller.

Ok but there is no double slash in front of the url specified. Its just /site/index. Can you please explain a bit more as to where should i remove the double slash from.?

try this


site/index.

No that didn’t worked. Still nothing happens when i click on the menu items. Man this is driving me crazy. Why isn’t such a simple thing working ?

Here is the code again


<!-- Header -->

<header>

    <div class="sticky-nav">

        <a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>


        <div id="logo">

            <a id="goUp" href="#home-slider" title="Easy Aesthetics">Easy Aesthetics</a>

        </div>


        <nav id="menu">

           <!-- <ul id="menu-nav">

                <li class="current"><a href="#home-slider">Home</a></li>

                <li><a href="#">Supplement Products</a></li>

                <li><a href="#work">Training</a></li>

                <li><a href="#about">Nutrition Guide</a></li>

                <li><a href="#contact">Affiliates</a></li>                        

                <li><a href="#" class="external">About Us</a></li>

            </ul>-->

                <?php $this->widget('zii.widgets.CMenu',array(

                        'id'=>'menu-nav',

                        'encodeLabel'=>false,

			'items'=>array(

				array('label'=>'Home', 'url'=>array('site/index')),

				array('label'=>'Supplement Products', 'url'=>array('/products')),

				array('label'=>'Training', 'url'=>array('/site/contact')),

                                array('label'=>'Nutrition Guide', 'url'=>array('/site/contact')),

                                array('label'=>'Affiliates', 'url'=>array('/site/contact')),

				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),

				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

			),

		)); ?>

            

        </nav> 





    </div>

</header>

<!-- End Header -->

I’ve made the changes you mentioned but that didn’t helped.

can you post the sitecontroller?

have you created the all action name?

Yes i will post the siteController. The code above is in a file named tpl_navigation.php.The themes directory is structured like this

/themes/

/themes/brushed

/themes/brushed/views

/themes/brushed/views/layouts

/themes/brushed/views/layouts /column1.php

  /themes/brushed/views/layouts                      /column2.php


      /themes/brushed/views/layouts                  /main.php


       /themes/brushed/views/layouts                 /header.php


        /themes/brushed/views/layouts                /index.php


         /themes/brushed/views/layouts              /navigation.php


           /themes/brushed/views/layouts             /tpl_footer.php


            /themes/brushed/views/layouts            /tpl_header.php


              /themes/brushed/views/layouts          /tpl_navigation.php

And here is the site control. Its the default code which is generated by Gii.


<?php


class SiteController extends Controller

{

	/**

	 * Declares class-based actions.

	 */

	public function actions()

	{

		return array(

			// captcha action renders the CAPTCHA image displayed on the contact page

			'captcha'=>array(

				'class'=>'CCaptchaAction',

				'backColor'=>0xFFFFFF,

			),

			// page action renders "static" pages stored under 'protected/views/site/pages'

			// They can be accessed via: index.php?r=site/page&view=FileName

			'page'=>array(

				'class'=>'CViewAction',

			),

		);

	}


	/**

	 * This is the default 'index' action that is invoked

	 * when an action is not explicitly requested by users.

	 */

	public function actionIndex()

	{

		// renders the view file 'protected/views/site/index.php'

		// using the default layout 'protected/views/layouts/main.php'

		$this->render('index');

	}


	/**

	 * This is the action to handle external exceptions.

	 */

	public function actionError()

	{

		if($error=Yii::app()->errorHandler->error)

		{

			if(Yii::app()->request->isAjaxRequest)

				echo $error['message'];

			else

				$this->render('error', $error);

		}

	}


	/**

	 * Displays the contact page

	 */

	public function actionContact()

	{

		$model=new ContactForm;

		if(isset($_POST['ContactForm']))

		{

			$model->attributes=$_POST['ContactForm'];

			if($model->validate())

			{

				$name='=?UTF-8?B?'.base64_encode($model->name).'?=';

				$subject='=?UTF-8?B?'.base64_encode($model->subject).'?=';

				$headers="From: $name <{$model->email}>\r\n".

					"Reply-To: {$model->email}\r\n".

					"MIME-Version: 1.0\r\n".

					"Content-Type: text/plain; charset=UTF-8";


				mail(Yii::app()->params['adminEmail'],$subject,$model->body,$headers);

				Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');

				$this->refresh();

			}

		}

		$this->render('contact',array('model'=>$model));

	}


	/**

	 * Displays the login page

	 */

	public function actionLogin()

	{

		$model=new LoginForm;


		// if it is ajax validation request

		if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')

		{

			echo CActiveForm::validate($model);

			Yii::app()->end();

		}


		// collect user input data

		if(isset($_POST['LoginForm']))

		{

			$model->attributes=$_POST['LoginForm'];

			// validate user input and redirect to the previous page if valid

			if($model->validate() && $model->login())

				$this->redirect(Yii::app()->user->returnUrl);

		}

		// display the login form

		$this->render('login',array('model'=>$model));

	}


	/**

	 * Logs out the current user and redirect to homepage.

	 */

	public function actionLogout()

	{

		Yii::app()->user->logout();

		$this->redirect(Yii::app()->homeUrl);

	}

}

Hi,

I think you should call a wrong controller in this theme there is no controller folder.

And if you can write a ‘/site/contact’ means in your project site view and site controller and in this site view you can create the contact.php file


protected/views/site/contact.php

But i’m just building the layout files. I haven’t touched any of the controller paramters. The controllers are still the default ones generated by Gii. The only thing i did was to include the line


"theme" => "brushed"

in my application config/main.php file.

Ok an interesting developement. The zii.widgets.CMenu works flawlessly. So if i change the href to some id within the page for example to #work or #contact then that menu item works. But if i specify any paths related to controllers it won’t work.

Here


<!-- Header -->

<header>

    <div class="sticky-nav">

        <a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>


        <div id="logo">

            <a id="goUp" href="#home-slider" title="Easy Aesthetics">Easy Aesthetics</a>

        </div>


        <nav id="menu">

         <!--   <ul id="menu-nav">

                <li class="current"><a href="/EasyAesthetics/index.php">Home</a></li>

                <li><a href="/EasyAesthetics/index.php/products">Supplement Products</a></li>

                <li><a href="#work">Training</a></li>

                <li><a href="#about">Nutrition Guide</a></li>

                <li><a href="#contact">Affiliates</a></li>                        

                <li><a href="/EasyAesthetics/index.php/admin" class="external">Admin</a></li>

            </ul> -->

                

                <?php  $this->widget('zii.widgets.CMenu',array(

                        'id'=>'menu-nav',

                        'encodeLabel'=>false,

			'items'=>array(

				array('label'=>'Home', 'url'=>array('/')),

				array('label'=>'Supplement Products', 'url'=>array('/products')),

				array('label'=>'Training', 'url'=>array('/#contact')), 

                                array('label'=>'Nutrition Guide', 'url'=>array('/#about')),

                                array('label'=>'Affiliates', 'url'=>array('/#work')),

				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),

				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

			),

		)); ?>

            

        </nav> 





    </div>

</header>

<!-- End Header --> 

So the Affiliates, Training and all the link with # in front of a url works. Basically this links resolves to localhost/DemoSite/index.php/#work.

But the Home and the Supplement Products link which resolves to http://localhost/EasyAesthetics/index.php/products, doesn’t work. If i copy and paste that link in the browser address bar it works, and i’m taken to the product page.

Very weird problem indeed.

Can you provide the "source code", when you use "view page source" to see the html code of the page. In this case, you should be able to see the actual url for each menu item.

sure here it is::





<!-- Require the header -->




<!DOCTYPE html>

<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->

<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->

<!--[if (IE <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->

<!--[if (IE 9)]><html class="no-js ie9" lang="en"><![endif]-->

<!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->

    <head>


        <!-- Meta Tags -->

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


        <script type="text/javascript" src="/demoProject/assets/28e7347b/jquery.js"></script>

<title>Demo Product Retrieval Systems</title>   


        <meta name="description" content="Insert Your Site Description" /> 


        <!-- Mobile Specifics -->

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <meta name="HandheldFriendly" content="true"/>

        <meta name="MobileOptimized" content="320"/>   


        

        <!-- Mobile Internet Explorer ClearType Technology -->

        <!--[if IEMobile]>  <meta http-equiv="cleartype" content="on">  <![endif]-->


        <!-- Bootstrap -->

        <link href="/demoProject/themes/brushed/css/bootstrap.min.css" rel="stylesheet">


        <!-- Main Style -->

        <link href="/demoProject/themes/brushed/css/main.css" rel="stylesheet">


        <!-- Supersized -->

        <link href="/demoProject/themes/brushed/css/supersized.css" rel="stylesheet">

        <link href="/demoProject/themes/brushed/css/supersized.shutter.css" rel="stylesheet">


        <!-- FancyBox -->

        <link href="/demoProject/themes/brushed/css/fancybox/jquery.fancybox.css" rel="stylesheet">


        <!-- Font Icons -->

        <link href="/demoProject/themes/brushed/css/fonts.css" rel="stylesheet">


        <!-- Shortcodes -->

        <link href="/demoProject/themes/brushed/css/shortcodes.css" rel="stylesheet">


        <!-- Responsive -->

        <link href="/demoProject/themes/brushed/css/bootstrap-responsive.min.css" rel="stylesheet">

        <link href="/demoProject/themes/brushed/css/responsive.css" rel="stylesheet">


        <!-- Supersized -->

        <link href="/demoProject/themes/brushed/css/supersized.css" rel="stylesheet">

        <link href="/demoProject/themes/brushed/css/supersized.shutter.css" rel="stylesheet">


        <!-- Google Font -->

        <link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900' rel='stylesheet' type='text/css'>


        <!-- Fav Icon -->

        <link rel="shortcut icon" href="#">


        <link rel="apple-touch-icon" href="#">

        <link rel="apple-touch-icon" sizes="114x114" href="#">

        <link rel="apple-touch-icon" sizes="72x72" href="#">

        <link rel="apple-touch-icon" sizes="144x144" href="#">


        <!-- Modernizr -->

        <script src="/demoProject/themes/brushed/js/modernizr.js"></script>


        <!-- Analytics -->

        <script type="text/javascript">


            var _gaq = _gaq || [];

            _gaq.push(['_setAccount', 'Insert Your Code']);

            _gaq.push(['_trackPageview']);


            (function() {

                var ga = document.createElement('script');

                ga.type = 'text/javascript';

                ga.async = true;

                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

                var s = document.getElementsByTagName('script')[0];

                s.parentNode.insertBefore(ga, s);

            })();


        </script>

        <!-- End Analytics -->


    </head>




    <body>

        <section id="header">


            <!-- Include the header bar -->

            <!-- This section is for Splash Screen -->

        <div class="ole">

            <section id="jSplash">

                <div id="circle"></div>

            </section>

        </div>

        <!-- End of Splash Screen -->


                   <!-- /.container -->  


        </section>

 <!-- Homepage Slider -->

        <div id="home-slider">	

            <div class="overlay"></div>


            <div class="slider-text">

                <div id="slidecaption"></div>

            </div>   


            <div class="control-nav">

                <a id="prevslide" class="load-item"><i class="font-icon-arrow-simple-left"></i></a>

                <a id="nextslide" class="load-item"><i class="font-icon-arrow-simple-right"></i></a>

                <ul id="slide-list"></ul>


                <a id="nextsection" href="#work"><i class="font-icon-arrow-simple-down"></i></a>

            </div>

        </div>

        <!-- End Homepage Slider -->

        




<!-- Require the navigation -->

<!-- Header -->

<header>

    <div class="sticky-nav">

        <a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>


        <div id="logo">

            <a id="goUp" href="#home-slider" title="Demo Product Retrieval Systems">Demo Product Retrieval Systems</a>

        </div>


        <nav id="menu">

         <!--   <ul id="menu-nav">

                <li class="current"><a href="/demoProject/index.php">Home</a></li>

                <li><a href="/demoProject/index.php/products">Supplement Products</a></li>

                <li><a href="#work">Training</a></li>

                <li><a href="#about">Nutrition Guide</a></li>

                <li><a href="#contact">Affiliates</a></li>                        

                <li><a href="/demoProject/index.php/admin" class="external">Admin</a></li>

            </ul> -->

                

                <ul id="menu-nav">

<li><a href="/demoProject/index.php">Home</a></li>

<li><a href="/demoProject/index.php/products">Supplement Products</a></li>

<li><a href="/demoProject/index.php/#contact">Training</a></li>

<li><a href="/demoProject/index.php/#about">Nutrition Guide</a></li>

<li><a href="/demoProject/index.php/#work">Affiliates</a></li>

<li><a href="/demoProject/index.php/site/logout">Logout (admin)</a></li>

</ul>            

        </nav> 





    </div>

</header>

<!-- End Header -->

<!-- Include content pages -->










        <div id="work" class="page">

            <div class="container">

                <!-- Title Page -->

                <div class="row">

                    <div class="span12">

                        <div class="title-page">

                            <h2 class="title">Welcome To Demo Product Retrieval Systems</h2>

                            <h3 class="title-description">Check Out New Supplements Prices in  <a href="#">here</a>.</h3>

                        </div>

                    </div>

                </div>

                <!-- End Title Page -->


                <!-- Portfolio Projects -->

                <div class="row">

                    <div class="span3">

                        <!-- Filter -->

                        <nav id="options" class="work-nav">

                            <ul id="filters" class="option-set" data-option-key="filter">

                                <li class="type-work">Categories</li>

                                <li><a href="#filter" data-option-value="*" class="selected">All</a></li>

                                <li><a href="#filter" data-option-value=".design">Training</a></li>

                                <li><a href="#filter" data-option-value=".photography">Nutritions</a></li>

                                <li><a href="#filter" data-option-value=".video">Video</a></li>

                            </ul>

                        </nav>

                        <!-- End Filter -->

                    </div>


                    <div class="span9">

                        <div class="row">

                            <section id="projects">

                                <ul id="thumbs">


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 design">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                 <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-01-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-01.jpg" alt="Not everyone loves doing pullups and chinups, but they are an absolutely necessary part of the Primal Blueprint Fitness program. See, with most other bodyweight exercises, it’s possible to make the case for the superiority of their weighted analogues.">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 design">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                        

                                                                                

                                        <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-02-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-02.jpg" alt="Go to any gym today and you will be lucky if you see five trainees that can execute a standing military press with 135lbs. If are fed up with your microscopic shoulder development then it is time to work on your overhead pressing power and join the ranks of the big boys.">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 photography">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-03-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-03.jpg" alt="Studies have shown that L-Glutamine supplementation can minimize breakdown of muscle and improve protein metabolism. Find out everything you need to know about glutamine and how it can help you!">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 video">

                                        <!-- Fancybox Media - Gallery Enabled - Title - Link to Video -->

                                                                                <a class="hover-wrap fancybox-media fancybox.iframe" data-fancybox-group="video" title="" href="http://www.youtube.com/embed/yuTyZMxrPMQ?autoplay=1">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-08.jpg" alt="Video">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 photography">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                 <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-04-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-04.jpg" alt=" Supplementing with Creatine Mono can replenish your creatine stores, an ingredient found naturally in foods like red meat.* Creatine helps fuel your muscles during high-intensity exercise.* Creatine isn't a stimulant like caffeine, so you may not 'feel' it immediately. Creatine works at the muscular level to support strength, power, explosive energy and endurance. ">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 photography">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-05-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-05.jpg" alt="Protein powders are popular with athletes, particularly those doing strength training. They provide a good source of nutrients and amino acids. Some people take whey protein because they are lactose intolerant or allergic to other protein sources, like eggs or soy. ">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 video">

                                                                                <!-- Fancybox Media - Gallery Enabled - Title - Link to Video https://www.youtube.com/watch?v=yuTyZMxrPMQ -->

                                        <a class="hover-wrap fancybox-media fancybox.iframe" data-fancybox-group="video" title="" href="http://www.youtube.com/embed/0ySC4I6B6qw?autoplay=1">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-09.jpg" alt="Video">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 design">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-06-full.jpg ">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-06.jpg" alt="Squats are the KING of all exercises because they are a “functional” exercise that affect your ability to live a full, healthy life. Anything from getting out of a chair, to squatting down to pick something off the floor requires squat strength. Especially as we get older, proper squat technique is absolutely critical to maintain health and longevity.">

                                    </li>

                                    <!-- End Item Project -->


                                    <!-- Item Project and Filter Name -->

                                    <li class="item-thumbs span3 design">

                                        <!-- Fancybox - Gallery Enabled - Title - Full Image -->

                                                                                 <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="" href="/demoProject/themes/brushed/img/work/full/image-07-full.jpg">

                                            <span class="overlay-img"></span>

                                            <span class="overlay-img-thumb font-icon-plus"></span>

                                        </a>

                                        <!-- Thumb Image and Description -->

                                        <img src="/demoProject/themes/brushed/img/work/thumbs/image-07.jpg" alt="Depending on how serious you are you can hit the gym anywhere from 3 to 5 days a week. I do 5. I made a basic workout routine which will be good for a starting point but make sure you experiment with other exercises and shock your body, I use this as a skeleton. Free weights are always better than machines because they hit all the  leg muscles.">

                                    </li>

                                    <!-- End Item Project -->

                                </ul>

                            </section>


                        </div>

                    </div>

                </div>

                <!-- End Portfolio Projects -->

            </div>

        </div><div id="about" class="page-alternate">

            <div class="container">

                <!-- Title Page -->

                <div class="row">

                    <div class="span12">

                        <div class="title-page">

                            <h2 class="title">Top Products</h2>

                            <h3 class="title-description">Check Out The Cheap Prices On These Products</h3>

                        </div>

                    </div>

                </div>

                <!-- End Title Page -->


                <!-- People -->

                <div class="row">

                    

                    <!-- Start Profile -->

                    <div class="span4 profile">

                                                <div class="image-wrap">

                            <div class="hover-wrap">

                                <span class="overlay-img"></span>

                                <span class="overlay-text-thumb">#1 Products</span>

                            </div>

                            <img src="/demoProject/themes/brushed/img/profile/profile-01.jpg" alt="#1 Product">

                        </div>

                        <h3 class="profile-name">Muscle Feast Creatine</h3>

                        <p class="profile-description">  After several months in the works, I am excited to be able to share with you what I consider to be the most comprehensive study on creatine ever conducted.

                            <a href="#">This study is the first of its kind and written from a place of zero bias.  </a>.                          




                            I would like to Thank Tyler W. LeBaron for his dedication to this project and for taking the time to uncover all possible scenarios in regards to what forms of creatine are the most effective in the market and which forms are not as beneficial.</p>


                        <div class="social">

                            <ul class="social-icons">

                                <li><a href="#"><i class="font-icon-social-twitter"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-dribbble"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-facebook"></i></a></li>

                            </ul>

                        </div>

                    </div>

                    <!-- End Profile -->


                    <!-- Start Profile -->

                    <div class="span4 profile">

                                                <div class="image-wrap">

                            <div class="hover-wrap">

                                <span class="overlay-img"></span>

                                <span class="overlay-text-thumb">#2 Product</span>

                            </div>

                            <img src="/demoProject/themes/brushed/img/profile/profile-02.jpg

" alt="#2 Product">

                        </div>

                        <h3 class="profile-name">Optimum Nutrition Hydrobuilder</h3>

                        <p class="profile-description">What gets done in the weight room doesn't build mass. It's what happens afterward that can make a big difference. Start your post-workout recovery with <a href="#"> ON's advanced all-in-one muscle builder.</a>. 

                            Platinum Hydrobuilder starts with a foundation of blended proteins and CreaPep peptides. 2.5 grams of BetaPower Betaine and 5 grams of Micronized Creapure Creatine complement an amino acid matrix that includes at least 13.5 grams of naturally occurring and added essential amino acids. At just 180 calories per serving, Platinum Hydrobuilder is ON's most comprehensive muscle building formula. </p>


                        <div class="social">

                            <ul class="social-icons">

                                <li><a href="#"><i class="font-icon-social-twitter"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-email"></i></a></li>

                            </ul>

                        </div>

                    </div>

                    <!-- End Profile -->


                    <!-- Start Profile -->

                    <div class="span4 profile">

                                                <div class="image-wrap">

                            <div class="hover-wrap">

                                <span class="overlay-img"></span>

                                <span class="overlay-text-thumb">#3 Product</span>

                            </div>

                            <img src="/demoProject/themes/brushed/img/profile/profile-03.jpg" alt="#3 Product">

                        </div>

                        <h3 class="profile-name">Six Star Pro Nutrition Whey</h3>

                        <p class="profile-description">In a six-week, <a href="#"> double-blind study involving 36 test subjects</a>. 

                            divided into three groups with at least three years of weight-training experience, subjects combining the core ingredients in Six Star® Whey Protein Plus with a weight-training program gained 70% more lean muscle than subjects using regular whey protein (8.8 vs. 5.1 lbs.).</p>


                        <div class="social">

                            <ul class="social-icons">

                                <li><a href="#"><i class="font-icon-social-twitter"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-linkedin"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-google-plus"></i></a></li>

                                <li><a href="#"><i class="font-icon-social-vimeo"></i></a></li>

                            </ul>

                        </div>

                    </div>

                    <!-- End Profile -->


                </div>

                <!-- End People -->

            </div>

        </div>

        <!-- End About Section -->

<!-- Contact Section -->

<div id="contact" class="page">

    <div class="container">

        <!-- Title Page -->

        <div class="row">

            <div class="span12">

                <div class="title-page">

                    <h2 class="title">Get in Touch</h2>

                    <h3 class="title-description">Get daily price updates right in your inbox.</h3>

                </div>

            </div>

        </div>

        <!-- End Title Page -->


        <!-- Contact Form -->

        <div class="row">

            <div class="span9">


                <form id="contact-form" class="contact-form" action="#">

                    <p class="contact-name">

                        <input id="contact_name" type="text" placeholder="Full Name" value="" name="name" />

                    </p>

                    <p class="contact-email">

                        <input id="contact_email" type="text" placeholder="Email Address" value="" name="email" />

                    </p>

                    <p class="contact-message">

                        <textarea id="contact_message" placeholder="Your Message" name="message" rows="15" cols="40"></textarea>

                    </p>

                    <p class="contact-submit">

                        <a id="contact-submit" class="submit" href="#">Send Your Email</a>

                    </p>


                    <div id="response">


                    </div>

                </form>


            </div>


            <div class="span3">

                <div class="contact-details">

                    <h3>Contact Details</h3>

                    <ul>

                        <li><a href="#">demoProject@gmail.com</a></li>

                        <li>(000) 000-0000</li>

                        <li>

                            Demo Product Retrieval Systems

                            <br>

                            Affiliate Site

                            <br>

                            USA

                        </li>

                    </ul>

                </div>

            </div>

        </div>

        <!-- End Contact Form -->

    </div>

</div>

<!-- End Contact Section -->


<!-- Twitter Feed -->

<div id="twitter-feed" class="page-alternate">

    <div class="container">

        <div class="row">

            <div class="span12">

                <div class="follow">

                    <a href="https://twitter.com/" title="Follow Me on Twitter" target="_blank"><i class="font-icon-social-twitter"></i></a>

                </div>


                <div id="ticker" class="query"> 

                </div>

            </div>

        </div>

    </div>

</div>

<!-- End Twitter Feed -->


<!-- Socialize -->

<div id="social-area" class="page">

    <div class="container">

        <div class="row">

            <div class="span12">

                <nav id="social">

                    <ul>

                        <li><a href="https://twitter.com/demoProject" title="Follow Me on Twitter" target="_blank"><span class="font-icon-social-twitter"></span></a></li>

                        <li><a href="http://dribbble.com/demoProject" title="Follow Me on Dribbble" target="_blank"><span class="font-icon-social-dribbble"></span></a></li>

                        <li><a href="http://forrst.com/people/demoProject" title="Follow Me on Forrst" target="_blank"><span class="font-icon-social-forrst"></span></a></li>

                        <li><a href="http://www.behance.net/alessioatzeni" title="Follow Me on Behance" target="_blank"><span class="font-icon-social-behance"></span></a></li>

                        <li><a href="https://www.facebook.com/demoProject" title="Follow Me on Facebook" target="_blank"><span class="font-icon-social-facebook"></span></a></li>

                        <li><a href="https://plus.google.com/" title="Follow Me on Google Plus" target="_blank"><span class="font-icon-social-google-plus"></span></a></li>

                        <li><a href="http://www.linkedin.com/in/" title="Follow Me on LinkedIn" target="_blank"><span class="font-icon-social-linkedin"></span></a></li>

                        <li><a href="http://themeforest.net/user/demoProject" title="Follow Me on ThemeForest" target="_blank"><span class="font-icon-social-envato"></span></a></li>

                        <li><a href="http://zerply.com/demoProject/public" title="Follow Me on Zerply" target="_blank"><span class="font-icon-social-zerply"></span></a></li>

                    </ul>

                </nav>

            </div>

        </div>

    </div>

</div>

<!-- End Socialize -->











<!-- Require the footer -->

 <!-- Footer -->

        <footer>

            <p class="credits">&copy;2013 demoProject. <a href="http://www.demoProject.com" title="Demo Product Retrieval Systems">Supplement Prices | Reviews | Training</a> by <a href="www.demoProject.com" title="scottfoesho">Scottfoesho</a></p>

        </footer>

        <!-- End Footer -->


        <!-- Back To Top -->

        <a id="back-to-top" href="#">

            <i class="font-icon-arrow-simple-up"></i>

        </a>

        <!-- End Back to Top -->




        <!-- Js -->

        <script src="/demoProject/themes/brushed/js/jquery-1.10.1.min.js"></script> <!-- jQuery Core -->

        <script src="/demoProject/themes/brushed/js/bootstrap.min.js"></script> <!-- Bootstrap -->

        <script src="/demoProject/themes/brushed/js/supersized.3.2.7.min.js"></script> <!-- Slider -->

        <script src="/demoProject/themes/brushed/js/waypoints.js"></script> <!-- WayPoints -->

        <script src="/demoProject/themes/brushed/js/waypoints-sticky.js"></script> <!-- Waypoints for Header -->

        <script src="/demoProject/themes/brushed/js/jquery.isotope.js"></script> <!-- Isotope Filter -->

        <script src="/demoProject/themes/brushed/js/jquery.fancybox.pack.js"></script> <!-- Fancybox -->

        <script src="/demoProject/themes/brushed/js/jquery.fancybox-media.js"></script> <!-- Fancybox for Media -->

        <script src="/demoProject/themes/brushed/js/jquery.tweet.js"></script> <!-- Tweet -->

        <script src="/demoProject/themes/brushed/js/plugins.js"></script> <!-- Contains: jPreloader, jQuery Easing, jQuery ScrollTo, jQuery One Page Navi -->

        <script src="/demoProject/themes/brushed/js/main.js"></script> <!-- Default JS -->

        <!-- End Js -->


    </body>

</html>




So you see the url which refers to the id of the current page with # in it works fine, but the others don’t.

So let me summary:

Below is two links you created:




<li><a href="/demoProject/index.php/#work">Affiliates</a></li>

<li><a href="/demoProject/index.php/site/logout">Logout (admin)</a></li>



and you said




href="/demoProject/index.php/#work"



is working, while




href="/demoProject/index.php/site/logout"



is not working.

But link "http://localhost/demoProject/index.php/site/logout" is working url.

then please change your original code




array('label'=>'Affiliates', 'url'=>array('/#work')),

array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),



to




array('label'=>'Affiliates', 'url'=>array('/#work')),

array('label'=>'Login', 'url'=>array($this->createUrl('/site/login')), 'visible'=>Yii::app()->user->isGuest),



See if it works. I think somthing wrong in your CMenu render after you applied new theme. You may need dig it out, but so far, hope createUrl can solve this issue quickly.