Maybe it's a stupid question

how can I put something in the right column? I mean with default theme, I want to use the space on the right, just below “Operations” menu. I don’t want to add items to menu, I want to use the space for other things (pictures, statistics, anything…)

There are few ways, but I would suggest you to use widgets, because you can use same widget accross multiple pages:

Check section about widgets on this page:

http://www.yiiframework.com/doc/guide/1.1/en/basics.view

Thanks,

Ivica

thanks for the answer, but still… I don’t understand how to output to right column: I create the widget (it’s not the first time) but when I call it it outputs in the main area (center-left)… how can I output into the right column?

Lets say that you want widget to appear on all pages, so in this case, you need to alter code in layouts/main.php . You need to add:

<div class="rightConent">

<?php $this->widget(‘path.to.WidgetClass’); ?>

</div>

It is up to you to set css class right way.

Then you have to create widget class and its view, like it is explained here:

http://www.yiiframework.com/doc/guide/1.1/en/basics.view#widget

The standard Yii template uses the Blueprint CSS framework. See http://blueprintcss.org

Here is a tutorial o become familiar with it.

/protected/views/layouts/column-2.php is where you should add your widget

You will already see CMenu widget there in left column

cool! thanks everybody for your answers. so I guess the smartest way to write things in the right panel not for every page, but just a couple, is to write a class with two methods: addItem and writeOutput. the first could be called from everywhere to add content. The latter for outputting/rendering the added items, and would be called from layouts/column-2.php.

thanks again to everybody!

Another way to do it is to create a new 2 column layout called column2_specific_name. Add you view data there. Then in your controllers set the layout property to use that new view.

ex:




public function actionIndex()

{

$this->layout = 'layouts/column2_specific_name';

}



I commonly do something like this




class ProjectController extends Controller

{


    /**

     * @var string the default layout for the views. Defaults to '//layouts/column1', meaning

     * using one-column layout. See 'protected/views/layouts/column1.php'.

     */

    public $layout = '//layouts/column1';


    public function init()

    {

        $this->layout = (Yii::app()->user->isAdmin) ? '//layouts/column2_admin_menu' : '//layouts/column1';


        parent::init();

    }

    ....

}



Cheers,

Matt

thanks matt!!