Post by okli » Sun Oct 28, 2018 1:17 am

Hi, can someone help me to develop simple HTML module based on the default HTML content module?
I am a beginner in developing, and I still don't have the necessary knowledge.
The name on the module will be "Banner by category" :)

I want to add banner in category page in the left sidebar. And to set manually in which category to show content.

I copy and modify files from HTML content module. Add some code in the view.tpl file in admin and controller file.

I add field Category in module admin. But when click not working, not showing categories to select them.

Can see in admin panel
http://oc.sieich.com/admin
user/pass
admin/admin
Extensions/Modules/HTML Content Pro -> Brand Banner Category

And another question is how to modify the code in the controller to work when the category is selected?

This is module code in GitHub I upload
https://github.com/chichebiev/BannerByCategory

I need from this functionality and I think the module will be helpful for another people and if I can do it a success. I will publish the module free. Please help me to create together the module.

Newbie

Posts

Joined
Thu Mar 31, 2016 9:34 pm

Post by Johnathan » Sun Oct 28, 2018 4:15 am

You don't need a new module to do this, the Layout system in OpenCart can already do this. You'd first create a banner module for each page where you want it to appear. Then, you'd create a Layout for each of those banners, with no "route" attached to it, and the modules you want assigned to that layout.

Once you've set that up, you can assign a Layout to an individual category by editing the category in Catalog > Categories, and choosing the layout in the "Design" tab. That category will then use that specific layout rather than the normal category layout, meaning it will display any modules assigned to its specific layout (i.e. the banner that you wanted).

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 6 guests