Post by oliwin » Sat Oct 28, 2017 3:06 am
How to display categories in home page with custom tpl twig template?
Re: How to display categories in home page?
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
Re: How to display categories in home page?
Tue Jan 10, 2017 2:00 am
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
Re: How to display categories in home page?
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
Re: How to display categories in home page?
Active Member
Posts
Joined
Fri Jun 17, 2011 6:39 pm
CONTACT
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
Re: How to display categories in home page?
Legendary Member
Joined
Mon Nov 14, 2011 11:38 pm
Location
Canada, ON
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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?
Post by straightlight » Sat Oct 28, 2017 4:42 am
Could you clarify ‘how to change template on own twig file’ ?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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)?
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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?
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Post by oliwin » Sat Oct 28, 2017 5:44 am
Please extend your answer, because it can not be useful
Post by straightlight » Sat Oct 28, 2017 5:47 am
No problem. Simply download an extension from the marketplace.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
source : https://forum.opencart.com/viewtopic.php?t=199107