Post by VrEx » Sat Jan 03, 2009 5:06 pm

Hi,

I would like to add to the home controller's template category controller. What steps should be done, that home controller could parse that category template correctly?

Newbie

Posts

Joined
Sat Jan 03, 2009 4:46 pm

Post by Qphoria » Sat Jan 03, 2009 9:51 pm

you want the category stuff on the home page?

You could rename

catalog/controller/home.php to home.php.old
catalog/language/english/controller/home.php to home.php.old
catalog/template/default/content/home.tpl to home.tpl.old

then make a copy of these category files and rename them to "home"
catalog/controller/category.php
catalog/language/english/controller/category.php
catalog/template/default/content/category.tpl

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by VrEx » Sat Jan 03, 2009 10:16 pm

But if I want to make module which has it's own stuff and includes some other modules, like category? In that way that including modules could be reused in other modules, without writing same code.
Last edited by VrEx on Sat Jan 03, 2009 10:23 pm, edited 1 time in total.

Newbie

Posts

Joined
Sat Jan 03, 2009 4:46 pm

Post by Qphoria » Sat Jan 03, 2009 10:31 pm

you could probably use php include on other controllers in side the home controller file, and then combine the tpl stuff into one.. I've not tried it

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by VrEx » Sat Jan 03, 2009 11:07 pm

Ok, I thought so too. Thanks.

Newbie

Posts

Joined
Sat Jan 03, 2009 4:46 pm

Post by JNeuhoff » Sun Jan 04, 2009 7:58 pm

If I understand the OpenCart structure correctly, it basically uses some top-level controllers which can be accessed in the URL as query string arguments, e.g. '?controller=controller&action=whatever', using templates from /catalog/template/default/content/*.tpl, which go into the main content pane of the main layout.tpl. And there are sub-controllers called modules, such as for the cart, currency, footer, header, etc. These are internally invoked from the toplevel-controllers and they use templates from /catalog/template/default/module/*.tpl.

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