Post by Qphoria » Mon Aug 18, 2008 8:59 pm

I wouldn't be the expert intermediate developer I am today without those 2 tools.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ptal » Tue Aug 26, 2008 9:45 pm

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

Newbie

Posts

Joined
Wed May 28, 2008 2:48 pm

Post by johny2k » Thu Aug 28, 2008 11:48 am

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

Code: 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'));
and modified catalog\template\default\layout.tpl as follows

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>
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.

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
Thanks for your sharing Bruce, i have been follow the code you provide. below is my home.php code,

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'));
	}
}
?>
& my catalog/template/defaul/layout.tpl code:

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>
& i only enable module special offer extensions, but my layout looks like got problem (please see the picture below). Can you tell me why? & what should i do? Thank you.

Attachments

???
problem.jpg

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by david.gilbert » Thu Aug 28, 2008 1:07 pm

Looks to me like your missing the CSS to style it correctly.

-Dave

Professional Website Services - http://www.davidmgilbert.com/


Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia

Post by johny2k » Thu Aug 28, 2008 1:41 pm

david.gilbert wrote: Looks to me like your missing the CSS to style it correctly.

-Dave
Hi, Dave, i`m still not understand. Can you show me where should i fix it? Thank you.

Regards,
John

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by bruce » Thu Aug 28, 2008 3:13 pm

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.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by johny2k » Thu Aug 28, 2008 3:23 pm

david.gilbert wrote: Looks to me like your missing the CSS to style it correctly.

-Dave
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.  ;) :-*

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 } ?>
Change to:

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 now my layout looks like picture below, hope this can provide some help to who need it, cheers............!!!!!

Attachments

???
done.jpg

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by kellen » Fri Aug 29, 2008 3:48 am

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.

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>

Attachments

???
modified_featured.jpg

Newbie

Posts

Joined
Wed Aug 13, 2008 8:28 am

Post by bruce » Fri Aug 29, 2008 10:57 am

Don't be shy, this is really good. And the way you did the unique large images is the only way of doing it, so well done there too.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by kellen » Wed Sep 03, 2008 12:07 pm

:) thanks bruce!

Newbie

Posts

Joined
Wed Aug 13, 2008 8:28 am

Post by WallyJ » Thu Sep 11, 2008 8:26 pm

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.
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

Newbie

Posts

Joined
Wed Sep 10, 2008 11:47 pm

Post by bruce » Thu Sep 11, 2008 9:04 pm

Yes, not featured.php but catalog\template\default\module\featured.tpl

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by WallyJ » Fri Sep 12, 2008 10:01 am

Thanks Bruce.... I made the change to 100%, changed "products" to "featured" in featured.ptl, but nothing happened...

What could I have missed?

Newbie

Posts

Joined
Wed Sep 10, 2008 11:47 pm

Post by bruce » Fri Sep 12, 2008 10:05 am

Possibly you put

featured

instead of

.featured

in default.css

If this page is on your web site, could you post a link?

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by WallyJ » Fri Sep 12, 2008 10:40 am

www.actforums.com is the site...

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;
}


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
Last edited by WallyJ on Fri Sep 12, 2008 11:06 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Sep 10, 2008 11:47 pm

Post by bruce » Fri Sep 12, 2008 1:47 pm

The style applied is not "featured" but is instead 

Code: Select all

.products, .images, .categories (line 220)
{
   float: left;
   width: 33.3%;
   text-align: center;
   cursor: pointer;
   font-size: 10px;
   height: 140px;
}
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.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by WallyJ » Fri Sep 12, 2008 8:13 pm

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.

Newbie

Posts

Joined
Wed Sep 10, 2008 11:47 pm

Post by bruce » Fri Sep 12, 2008 8:52 pm

My pleasure.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by drkramik » Tue Dec 23, 2008 8:30 pm

bruce wrote:
The answer to your second question has been answered many times on the forums. You only need to search.
You may post links then because i couldn't find the answer browsing the forum...
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.

Newbie

Posts

Joined
Tue Dec 23, 2008 6:57 pm

Post by JNeuhoff » Tue Dec 23, 2008 10:01 pm

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.php

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 4 guests