$this and user module?

I have a sidebar widget (CListView inside CPortlet). There are links in the listView created with:


 echo CHtml::link(CHtml::encode($data->title), array($where, 'id'=>$data->item_id), array('align'=>'left')); 

When I am on a page that is part of the User module, these links have have /user appended to the front of the link address. It throws an error, duh!

Once I am out of the user pages, everything works fine.

This is how I am invoking the widget in the triplets layout:




<?php

            	$this->beginWidget('zii.widgets.CPortlet', array(

					'title'=>'Featured',

				));

				

				$criteria=new CDbCriteria;

				$criteria->condition = "status=:status";

				$criteria->params = array(':status' => 'Active');

				$criteria->order = 'weight ASC, insert_datetime DESC';

				

				$dataProvider=new CActiveDataProvider('Featured', array(

					'criteria'=>$criteria,

					'pagination'=>array(

						'pageSize'=>$page_size,

					),

				));

				

				$summaryText=Yii::t('zii','{start}-{end} of {count}');

				

				$this->widget('zii.widgets.CListView', array(

					'dataProvider'=>$dataProvider,

					'summaryText'=>$summaryText,

					'itemView'=>'//featured/_sidebarview',  // partial view

					'pager'=>array(

						'class'=>'CLinkPager',

						'header'=>false,

						'firstPageLabel'=>'&lt;&lt;',

						'prevPageLabel'=>'&lt;',

						'nextPageLabel'=>'&gt;',	

						'lastPageLabel'=>'&gt;&gt;',

						'maxButtonCount'=>3,

					),

				));

				

				$this->endWidget();

			?>



I assume the problem is an incorrect usage of $this in the invocation, but I don’t really know and I don’t know what to do about it.

Can someone guide me please?

Thanks,

Alex

How do you define the variable $where?

/Tommy

It would help if you included here the error message.

If you want to keep the links good regardless of where you are, use a double slash in front of ‘user’ -> ‘//user’.

If I remember it correctly.

Or try with a single slash if two doesn’t work. ;)