Yii Framework Forum: Styling Zii Widgets - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Styling Zii Widgets Rate Topic: -----

#1 User is offline   Foghist 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 31-January 13

Posted 08 April 2013 - 02:50 PM

Hi guys, i'm having trouble understanding how to style a zii widget. What i want to do is to style this CJuiTabs widget:
<?php
			$this->widget('zii.widgets.jui.CJuiTabs',array(
				'tabs'=>$some-array,
				'options'=>array(
					'collapsible'=>false,
				),
				'id'=>'some-id',
			)); ?>

The problem I'm having is that the widget is styled by a css-file stored in the assets folder. I've read somewhere that you should never change anything in the assets folder (with exceptions of course), and that you had to copy the css file into your css folder, and then call it inside the widget. I'm not sure if this is the right approach, and if it is then what css-file should i be looking for and how should i call it from the widget once it has been copied to the css folder?
0

#2 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 08 April 2013 - 11:27 PM

View PostFoghist, on 08 April 2013 - 02:50 PM, said:

Hi guys, i'm having trouble understanding how to style a zii widget. What i want to do is to style this CJuiTabs widget:
<?php
			$this->widget('zii.widgets.jui.CJuiTabs',array(
				'tabs'=>$some-array,
				'options'=>array(
					'collapsible'=>false,
				),
				'id'=>'some-id',
			)); ?>

The problem I'm having is that the widget is styled by a css-file stored in the assets folder. I've read somewhere that you should never change anything in the assets folder (with exceptions of course), and that you had to copy the css file into your css folder, and then call it inside the widget. I'm not sure if this is the right approach, and if it is then what css-file should i be looking for and how should i call it from the widget once it has been copied to the css folder?




Try this and overide style in tabsstyle.css

<?php
			$this->widget('zii.widgets.jui.CJuiTabs',array(
				'tabs'=>$some-array,
				'options'=>array(
					'collapsible'=>false,
				),
                                 'cssFile' => Yii::app()->baseUrl . '/css/tabsstyle.css',

				'id'=>'some-id',
			)); ?>

0

#3 User is offline   Foghist 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 31-January 13

Posted 09 April 2013 - 12:04 AM

If I do that, I get the following style-link in the head:
<link rel="stylesheet" type="text/css" href="/Site/assets/6833b40d/jui/css/base//Site/css/tabs-jquery-ui" />

0

#4 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 09 April 2013 - 02:26 AM

View PostFoghist, on 09 April 2013 - 12:04 AM, said:

If I do that, I get the following style-link in the head:
<link rel="stylesheet" type="text/css" href="/Site/assets/6833b40d/jui/css/base//Site/css/tabs-jquery-ui" />



this will not works you always... This not the correct method...
0

#5 User is offline   Foghist 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 31-January 13

Posted 09 April 2013 - 03:20 AM

well, then how do i get it to show this instead?:
<link rel="stylesheet" type="text/css" href="/Site/css/tabs-jquery-ui" />

0

#6 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 09 April 2013 - 11:57 PM

View PostFoghist, on 09 April 2013 - 03:20 AM, said:

well, then how do i get it to show this instead?:
<link rel="stylesheet" type="text/css" href="/Site/css/tabs-jquery-ui" />



                        $this->widget('zii.widgets.jui.CJuiTabs',array(
                                'tabs'=>$some-array,
                                'options'=>array(
                                        'collapsible'=>false,
                                ),
                                 'cssFile' => Yii::app()->baseUrl . '/Site/css/tabs-jquery-ui.css',

                                'id'=>'some-id',
                        )); ?>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users