Post by osglass » Thu Aug 21, 2008 6:24 pm

The information i have in the homepage is hard code. For example I will create about us page on the admin->catalog->information. Is there someway i can call the about us page on the home.tpl?

Free solution is well appreciated. =)

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by fido-x » Thu Aug 21, 2008 6:31 pm

You could always try my "Homepage Upgrade" package which is available from my own site (http://www.fido-x.net/) or from the contributions site (http://www.opencart.com/contribution/in ... tion_id/58. This will give you admin/database control over the contents of the home page. And, yes, it is free.

Regards, Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by osglass » Thu Aug 21, 2008 7:41 pm

Actually i already got a solution but Let me try this methods of your buddy. I will update u soon buddy

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by osglass » Thu Aug 21, 2008 8:18 pm

hey fido-x what version of opencart this contribution of your works?

Im using opencart_v0.7.7. Will this work on opencart_v0.7.7?


UPDATE: IT WORKS!!!! Although I got some errors. I just delete the code below that has [delete][delete].

Code: Select all

<script type="text/javascript" src="catalog/javascript/ajax/jquery.js"></script>
<script type="text/javascript" src="catalog/javascript/thickbox/thickbox-compressed.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/javascript/thickbox/thickbox.css" />
<link rel="stylesheet" type="text/css" href="catalog/template/default/css/home.css" />
<div class="heading"><?php echo $heading_title; ?></div>
[delete]<?php echo $text_greeting; ?>[delete]
<?php foreach ($homepage as $homepage_info) { ?>
	<?php if ($homepage_info['sort_order'] % 2 != 1) { $float = $text_left; } else { $float = $text_right; } ?>
	<div class="homepage">
		<?php if ($homepage_info['image_id'] > 0) { ?>
			<div class="homepage_image" style="float:<?php echo $float; ?>;">
				<a href="<?php echo $homepage_info['filename']; ?>" title="<?php echo $homepage_info['title']; ?>" class="thickbox">
					<img src="<?php echo $homepage_info['thumb']; ?>" title="<?php echo $homepage_info['title']; ?>" alt="<?php echo $homepage_info['title']; ?>" />
				</a>
			</div>
		<?php } ?>
		<div class="homepage_heading"><?php echo $homepage_info['title']; ?></div>
		<div class="homepage_story"><?php echo $homepage_info['description']; ?></div>
	</div>
<?php } ?>
[delete]<div class="heading"><?php echo $text_latest; ?></div> 
<?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 } ?>[delete]
Last edited by osglass on Thu Aug 21, 2008 8:26 pm, edited 1 time in total.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by osglass » Thu Aug 21, 2008 8:45 pm

Fido-x.. in the admin->catalog->homepage

There are 3 tab: The General, Data and Image.

Everytime i view the homepage theres an image above my entry. How can remove this man?

UPDATE: hehehe.. Its okay now... I just commented the PHP code that calls the image hehehe.
Last edited by osglass on Thu Aug 21, 2008 8:52 pm, edited 1 time in total.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by fido-x » Thu Aug 21, 2008 9:24 pm

Hi Osglass,

Glad to hear you got it working. Sorry about the errors - the controller in the package has had the "text_greeting" and Latest Products removed - I didn't actually mean to, must have taken the controller from my own setup and put that into the package instead of making the changes to the controller from a default setup. Thanks for letting me know about the errors, I'll update the package to fix them (when I get a chance ;D).

As for the image issue, this is a problem with OpenCart. It seems that whenever you add/edit some entry that has provision to add an image (eg. categories, products), the first image will ALWAYS be added, whether you want one or not.

To prevent display of the image, you can change the line that reads-

Code: Select all

<?php if ($homepage_info['image_id'] > 0) { ?>
to

Code: Select all

<?php if ($homepage_info['image_id'] > 1) { ?>
then it will only display an image if you actually attach one to the entry.

Regards, Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by WallyJ » Fri Sep 12, 2008 8:46 am

I changed the 0 to a 1 and still get the image. What am I missing?

ADDENDUM:  I changed the 0 to 100, and now it works, the image does not show on the page.
I'd like to remove it all together and simply put images in the editor for the page if I want to see one.

Please advise. Thanks.
Last edited by WallyJ on Fri Sep 12, 2008 8:51 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Sep 10, 2008 11:47 pm

Post by fido-x » Fri Sep 12, 2008 9:41 am

Commenting or deleting this section in "catalog/template/default/content/home.tpl"

Code: Select all

<?php if ($homepage_info['image_id'] > 1) { ?>
  <div class="homepage_image" style="float:<?php echo $float; ?>;">
    <a href="<?php echo $homepage_info['filename']; ?>" title="<?php echo $homepage_info['title']; ?>" class="thickbox">
      <img src="<?php echo $homepage_info['thumb']; ?>" title="<?php echo $homepage_info['title']; ?>" alt="<?php echo $homepage_info['title']; ?>" />
    </a>
  </div>
<?php } ?>
will stop the images from being displayed on the home page.

Regards, Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 1 guest