Wow,
I got it working. It wasn't 'white-space:nowrap;' after all. It seemed that Firefox took the width as 33.3% from the .products in the default.css .
I added a new .featured in the default.css and changed the width to 100%; pointed the class ="featured" in the featured.php and firefox leaped with joy. This should probably be an update because it will affect any shopper who uses firefox for every store.
It now works like a charm.
Phil
I got it working. It wasn't 'white-space:nowrap;' after all. It seemed that Firefox took the width as 33.3% from the .products in the default.css .
I added a new .featured in the default.css and changed the width to 100%; pointed the class ="featured" in the featured.php and firefox leaped with joy. This should probably be an update because it will affect any shopper who uses firefox for every store.
It now works like a charm.
Phil
Thanks for your sharing Bruce, i have been follow the code you provide. below is my home.php code,bruce wrote: I recently installed this contribution as follows and it works perfectly.
After following the installation instructions, I put the following (some surrounding code shown for positioning) into catalog\controller\home.php
and modified catalog\template\default\layout.tpl as followsCode: Select all
$template->set('content', $view->fetch('content/home.tpl')); $template->set($module->fetch()); $template->set('show_latest', true); $template->set('show_specials', true); $template->set('show_featured', true); $response->set($template->fetch('layout.tpl'));
So for example, $latest is set if the module is enabled and you only have to set $show_latest in the template of the controller(s) where you want to display the latest products.Code: Select all
<div id="content"> <?php if (isset($content)) echo $content; if (isset($latest) & isset($show_latest)) echo $latest; if (isset($featured) & isset($show_featured)) echo $featured; if (isset($specials) & isset($show_specials)) echo $specials; ?> </div>
Please note
- the code snippet as shown, would display them all on in the home page.
- the isset check on $content that was around the content div is moved inside the content div
- putting everything including $content inside the content div maintains a continuous line on the left side for the default template
catalog/controller/home.php
Code: Select all
$view->set('products', $product_data);
$template->set('content', $view->fetch('content/home.tpl'));
$template->set($module->fetch());
$template->set('show_specials', true);
$template->set('show_featured', true);
$response->set($template->fetch('layout.tpl'));
}
}
?>
Code: Select all
<div id="column">
<?php if (isset($cart)) { ?>
<?php echo $cart; ?>
<?php } ?>
<?php if (isset($category)) { ?>
<?php echo $category; ?>
<?php } ?>
<?php if (isset($review)) { ?>
<?php echo $review; ?>
<?php } ?>
<?php if (isset($information)) { ?>
<?php echo $information; ?>
<?php } ?>
</div>
<div id="content">
<?php
if (isset($content)) echo $content;
if (isset($featured) & isset($show_featured)) echo $featured;
if (isset($specials) & isset($show_specials)) echo $specials;
?>
</div>
<?php if (isset($footer)) { ?>
<div id="footer"><?php echo $footer; ?></div>
<?php } ?>
</div>
<?php if (isset($time)) { ?>
<div id="time"><?php echo $time; ?></div>
<?php } ?>
</body>
</html>
Looks to me like your missing the CSS to style it correctly.
-Dave
-Dave
Professional Website Services - http://www.davidmgilbert.com/
Active Member
Hi John,
There is nothing broken with the code or layout. Except that it is not beautiful.
You just need to change the file catalog\template\default\module\featured.tpl (and specials.tpl) to produce a more pleasing result. These templates use default.css as the source of styles so you may need to add some styles there too.
There is nothing broken with the code or layout. Except that it is not beautiful.

You just need to change the file catalog\template\default\module\featured.tpl (and specials.tpl) to produce a more pleasing result. These templates use default.css as the source of styles so you may need to add some styles there too.
Hi, Dave & Bruce. I have been solve it myself, below is the code i modify. Really thanks to all of you, especially Bruce. I will try my best to help other member to solve the problem.david.gilbert wrote: Looks to me like your missing the CSS to style it correctly.
-Dave


I modify catalog\template\default\module\special.tpl
From:
Code: Select all
<p class="heading"><?php echo $heading_title; ?></p>
<?php if ($products) { ?>
<table style="width:100%;">
<?php foreach ($products as $product) { ?>
<tr class="products">
<td style="width:33.3%;"><a href="<?php echo $product['href']; ?>">
<img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>"
alt="<?php echo $product['name']; ?>" /></a></td>
<td><b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b> - <?php echo $product['desc']; ?></td>
<td><?php echo $product['price']; ?></td>
</tr>
<?php } ?>
</table>
<?php } else { ?>
<p><?php echo $text_notfound; ?></p>
<?php } ?>
Code: Select all
<p class="heading"><?php echo $heading_title; ?></p>
<?php if (isset($products)) { ?>
<?php foreach ($products as $product) { ?>
<div class="products"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a><br />
<b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b><br />
<?php echo $product['price']; ?></div>
<?php } ?>
<?php } else { ?>
<p><?php echo $text_notfound; ?></p>
<?php } ?>
So I'm not sure if anyone is interested or not, but I will post code for my modified featured.tpl and a picture. I got rid of the product descriptions, then used only 2 columns and added a 3rd larger column for pictures or text or something. Please note that the large pictures are hard coded in because I'm not skilled enough to add something to the admin menu
Like I said, not sure if anyone is interested but I thought id see if I could contribute a bit with my n00bish abilities.
Like I said, not sure if anyone is interested but I thought id see if I could contribute a bit with my n00bish abilities.
Code: Select all
<!-- Initialize Counter -->
<?php $monkeycount = 0; ?>
<!-- Heading -->
<p class="heading"><?php echo $heading_title; ?></p>
<!-- Main containment table -->
<table style="width: 100%; text-align: center; padding: 0px">
<tr>
<td style="width: 50%">
<!-- Product table -->
<table style="width: 100%; text-align: center; padding: 0px">
<tr>
<?php if ($products) { ?>
<?php foreach ($products as $product) { ?>
<td style="width: 25%" valign="top">
<div class="products2">
<a href="<?php echo $product['href']; ?>">
<img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>">
</a><br />
<b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b><br />
<?php echo $product['price']; ?>
</div>
</td>
<!-- New row if statement -->
<?php $monkeycount = $monkeycount + 1; ?>
<?php if($monkeycount > 1) { ?>
</tr><tr>
<?php $monkeycount = 0; ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<p><?php echo $text_notfound; ?></p>
<?php } ?>
</tr>
</table>
</td>
<!-- Picture column -->
<td style="width: 75%; border-left: 1px solid #000000" valign="top">
<div style="text-align: center; width: 100%">
<img class="bigimage" src="/replace_imgagePATH/" width="90%" height="90%" alt=""/>
</div>
<br />
<div style="text-align: center; width: 100%">
<img class="bigimage" src="/replace_imgagePATH/" width="90%" height="90%" alt=""/>
</div>
</td>
</tr>
</table>
I like ptal's suggestion below... but I'm not sure how to add the class to the featured.php.
I already added the new "featured" class to the default css, but I don't see a class in the featured.php and am unsure of where to add this new class to fix the firefox bug.
Thanks.
I already added the new "featured" class to the default css, but I don't see a class in the featured.php and am unsure of where to add this new class to fix the firefox bug.
Thanks.
ptal wrote: Wow,
I got it working. It wasn't 'white-space:nowrap;' after all. It seemed that Firefox took the width as 33.3% from the .products in the default.css .
I added a new .featured in the default.css and changed the width to 100%; pointed the class ="featured" in the featured.php and firefox leaped with joy. This should probably be an update because it will affect any shopper who uses firefox for every store.
It now works like a charm.
Phil
www.actforums.com is the site...
Here is the section of my default.css
still not sure what to do. Thanks for taking a look! Looks fine in IE, not firefox... and is there a way to shorten the descriptions, like the Review sidebox does... But first, the Firefox fix... hehe
Here is the section of my default.css
Code: Select all
.products, .images, .categories {
float: left;
width: 33.3%;
text-align: center;
cursor: pointer;
font-size: 10px;
height: 140px;
}
.featured {
float: left;
width: 100%;
text-align: center;
cursor: pointer;
font-size: 10px;
height: 140px;
}
Last edited by WallyJ on Fri Sep 12, 2008 11:06 am, edited 1 time in total.
The style applied is not "featured" but is instead
you need to change to
It is not a "bug" in firefox either. Safari displays the same. IE tends to interpret width percentages based on page width whereas firefox does it based on the container width.
To get them all working the same, set the width as a fixed pixel amount.
Code: Select all
.products, .images, .categories (line 220)
{
float: left;
width: 33.3%;
text-align: center;
cursor: pointer;
font-size: 10px;
height: 140px;
}
It is not a "bug" in firefox either. Safari displays the same. IE tends to interpret width percentages based on page width whereas firefox does it based on the container width.
To get them all working the same, set the width as a fixed pixel amount.
At first I was confused, because I knew I had made that change in the tpl file. But I realized that I only made the change in the "featured.tpl" file, and not the files for "latest" and "specials".
You have to make the change in all files that you are showing on the home page.
Thanks Bruce.
You have to make the change in all files that you are showing on the home page.
Thanks Bruce.
You may post links then because i couldn't find the answer browsing the forum...bruce wrote:
The answer to your second question has been answered many times on the forums. You only need to search.
I have found the footer.tpl but i would like to know where is located the "$text_powered_by" and being able to modify it. Thanks.
It's located in file /catalog/language/english/extension/module/footer.phpI have found the footer.tpl but i would like to know where is located the "$text_powered_by" and being able to modify it. Thanks.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Who is online
Users browsing this forum: No registered users and 4 guests