I am working with the boilerplate theme and I need to have a different width for my columns on the front page to rest of the site. Previously with this site, using the zen theme, I have used a separate template for the home page, added some new classes and ids to the html in the front page template and adjusted these in the layout.css However I am having no success with this technique with boilerplate and I am wondering if you can point out something I may have overlooked here.
On the base.scss file I have added the following width declarations so I have four widths like so:
//
// Widths
//
$first_sidebar_width: 200px;
$first_sidebar_width_front: 225px;
$second_sidebar_width: 200px;
$second_sidebar_width_front: 225px;
$page_width: 960px;then in layout I have added another declaration as so
.two-sidebars, .sidebar-first {
.centerfront {
margin-left: percentage($first_sidebar_width_front / $page_width);
}
}And I have also added another width here:
#sidebar-first-front {
width: percentage($first_sidebar_width_front / $page_width);
margin-right: -$first_sidebar_width_front;
}In my page—front.tpl.php I have added in these new classes and Ids as so:
<?php if ($page['sidebar_first']): ?>
<aside id="sidebar-first-frontpage" class="column sidebar first">
<div id="sidebar-first-inner" class="inner">
<?php print render($page['sidebar_first']); ?>
</div>
</aside>
<?php endif; ?> <!-- /sidebar-first -->
<?php if ($page['sidebar_second']): ?>
<aside id="sidebar-second-frontpage" class="column sidebar second">
<div id="sidebar-second-inner" class="inner">
<?php print render($page['sidebar_second']); ?>
</div>
</aside>
<?php endif; ?> <!-- /sidebar-second -->This method is not working, and on the home page, the width of the first column (the left) is taking up nearly the whole page.
I am hoping you can confirm that it is possible to have two layouts in this way using the boilerplate theme, and is there a preferred or best practice way to do this with this theme?
Many thanks,
Renaee.
Comments
Comment #1
Renzy commentedComment #2
Renzy commentedThis must be doable, just being lazy here. I will persist and if I can find an easy solution will post to assist others who may be in same boat.
Comment #3
Renzy commentedI did manage to work this out eventually. However I have now noticed that the front page with the separate template does not resize down for handheld devices, where as the rest of the site does. any clues most appreciated.
Comment #4
Renzy commentedApologies again! obviously the same changes also need to be made in the _mobile.scss file - still finding my way around this new theme! please feel free to delete this issue altogether. marking as closed.