Yii Framework Forum: A Discussion on CSS implementation in Yii - Yii Framework Forum

Jump to content

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

A Discussion on CSS implementation in Yii Rate Topic: -----

#1 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 688
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 22 December 2010 - 04:31 PM

I am new to frameworks in general and Yii specifically. In looking at the file structure, themeing, widgets, etc.; It seems to me that the Yii really goes against the write once, use everywhere tenants of programming when it comes to CSS and views.

In the basic WebApp generation I see 'bg.gif' in at least 4 different places. Shouldn't it be in only one?
With Themes, that gets multiplied. I was looking into using themes for changing a site for various holidays. Now I have to copy my layout pages to ALL of the themes.

I hope you see what I'm getting at, I'm not sure that I am explaining it right. Can any of you Yii gurus help a lowly newbie understand some of the background/reasoning/voodoo/etc of the design?

Thanks.
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#2 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 December 2010 - 04:48 PM

I am not sure what you mean?
I only see bg.gif in one place: root/images.

Keep the common view/layout in protected/views.
Theme specific stuff goes in themes/your_theme/css|images|views.
If Yii can't find it in your theme directory, it will try to find it in the 'global' directories.
"Less noise - more signal"
0

#3 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 688
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 22 December 2010 - 05:00 PM

View Postjacmoe, on 22 December 2010 - 04:48 PM, said:

I am not sure what you mean?
I only see bg.gif in one place: root/images.

Keep the common view/layout in protected/views.
Theme specific stuff goes in themes/your_theme/css/images/views.
If Yii can't find it in your theme directory, it will try to find it in the 'global' directories.


All of the root/assets directories also get the bg.gif.

The themes don't rollover the "main" info. I tried a theme from the web. all of my main menu items where lost and set to the theme/.../layouts/main.
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 December 2010 - 05:39 PM

View Postjkofsky, on 22 December 2010 - 05:00 PM, said:

All of the root/assets directories also get the bg.gif.

The asset manager publishes assets in the assets directory. Don't worry about it.


View Postjkofsky, on 22 December 2010 - 05:00 PM, said:

The themes don't rollover the "main" info. I tried a theme from the web. all of my main menu items where lost and set to the theme/.../layouts/main.

No there were not.
Is there a column1.php and column2.php in your theme directory?
Compare them to protected/views/layouts/column1|2.php.
"Less noise - more signal"
0

#5 User is offline   Igor Ivanovic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 211
  • Joined: 17-October 10
  • Location:Zagreb

Posted 22 December 2010 - 06:00 PM

Put your images in root document http_docs, under image directory.

In css write

.class{
background:url('../images/example.jpg');
}

layouts are rendered in main application php, you can`t setup image from protected folder because you have in .htaccess configured deny for all

NOTE: don`t change that
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