Post by oliwin » Sat Oct 28, 2017 3:06 am

How to display categories in home page with custom tpl twig template?

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by yodapt » Sat Oct 28, 2017 3:22 am

Call that template instead of the default one in the common/home controller

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by oliwin » Sat Oct 28, 2017 3:29 am

Where to turn on this in admin panel? And where to replace? Can you extend you answer, please

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by oliwin » Sat Oct 28, 2017 3:32 am

Because I need to display categories in home page with my own design, and on another page with another

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by yodapt » Sat Oct 28, 2017 3:46 am

There is no "turn on", you have to do it by hand.

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by straightlight » Sat Oct 28, 2017 3:47 am

In order to use an on and off status, what you`d be looking for is a module. Opencart already provides a category module from the admin - > extensions - > extensions - > modules page. All you need to do is to install, then edit the module. In the edit form, enable the module. Then, save the changes. Once the successful message appears on the redirected page, you will be informed that a layout can be defined for your activated module. Click on the layout link. Set the category module route for your home page (you can look at other routes on that list for an example) and save the changes. You will be all set to view the categories from the home page.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by oliwin » Sat Oct 28, 2017 3:52 am

I did that I have installed this module in extentioons. Then I moved in Layers and added this module to home layer. But how to change template on own twig file, where?

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by straightlight » Sat Oct 28, 2017 4:42 am

Could you clarify 'how to change template on own twig file' ?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by oliwin » Sat Oct 28, 2017 5:08 am

By default there is template category.twig.


I need to create the same template with custom CSS styles and HTML structure. How to create that and display only on the main page(home)?

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by straightlight » Sat Oct 28, 2017 5:16 am

You could easily do this by using your replicated category module by using jQuery and add it to your own category TWIG file without the need to use any additional extensions. See this link: https://stackoverflow.com/questions/784 ... ing-jquery . Or you can always find an extra one from the MarketPlace.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by oliwin » Sat Oct 28, 2017 5:28 am

No it is not suitable for me. Can I create some templates of category.twig and use then on several pages?

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by straightlight » Sat Oct 28, 2017 5:30 am

Yes, this could be done easily within a JS or you could create a new PHP controller and return the values you'd require inside another main controller so that each associated peace of TWIG files you'd like to integrate could come together.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by oliwin » Sat Oct 28, 2017 5:44 am

Please extend your answer, because it can not be useful

New member

Posts

Joined
Tue Jan 10, 2017 2:00 am

Post by straightlight » Sat Oct 28, 2017 5:47 am

No problem. Simply download an extension from the marketplace.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 14 guests