By eddy147 on
Suppose my frontpage will have a different layout than my other pages. Therefore i need at least 2 stylesheets.
Now we can only use style.css.
Is it possible to use more than 1 stylesheet???
Suppose my frontpage will have a different layout than my other pages. Therefore i need at least 2 stylesheets.
Now we can only use style.css.
Is it possible to use more than 1 stylesheet???
Comments
page-front.tpl
A couple of thoughts:
1) Create a page-front.tpl file by duplicating and modifying page.tpl.php
put a class on the body tag
<body class="mybodyclass">and use that to overide/specify your styles in style.css.mybodyclass .mystyle2) put another link to a custom css just below $styles in page-front.tpl
<style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/custom.css";</style>putting your css in custom.css
cool...
1) makes so much sense... thank you!
I'm wondering though... in my page.tpl.php, the code uses $body_classes for the body class.
Will hardcoding this on page-front.tpl.php adversely affect my install?
Thanks very kindly,
CB
How exactly do i do this?
I haven't worked much with the css and template pages in drupal so I'm still a bit confused...
where *exactly* am I supposed to add .mybodyclass and .mystyle ?
and on the /custom.css part i can change that to the name of my actual custom css file for the front page, right?
Hopefully this is dead obvious to you guys and you can help me out! I would really appreciate it :)
Ha
Check your HTML source with your browser. I bet you find that you're already using a minimum of 6 style sheets. Most of my sites have 10 or more.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
For creating multiple
For creating multiple style-sheets, first create .tpl file, for duplicating and modifying create demo.tpl.php. There is two file using for multiple style sheet. One is demo-page.tpl.php and other is demo-front.tpl.
.info files
Most themes have a list of stylesheets in their .info files. You can add to that list quite easily.
NancyDru
Hi
I assume you are planning to put those 'styles' only for the frontpage right? Then, if me I'll just use some small snippet into my default page.tpl.php.
Something like