Displaying FlexBanner on specific modules only

This is the place to post questions and comments about the FlexBanner component
Post Reply
tachyon
Posts: 2
Joined: Mon May 12, 2014 12:32 am

Displaying FlexBanner on specific modules only

Post by tachyon » Mon May 12, 2014 12:58 am

I would like to modify FlexBanner to display only on specific modules assigned to a set of menu items.

For example, I have assigned a set of categories in FlexBanner. I also have a set of Virtuemart item categories. I would like to setup a relation between these two categories, so that a set of banners in its assigned category can only be shown in a Virtuemart category. This would ultimately be a many-to-many relationship, but to simplify, let's say I want to setup a one-to-one relationship, for now.

To illustrate; if I setup a "Storage/Hard disk" category in FlexBanner, then this set of banners will be shown only in FlexBanner modules assigned to Virtuemart category "Storage/Hard disk" and not on any other categories.

To achieve this I assume that I would have to modify #__flexbannersin to include a new 'moduleid' field initially, which of course would be the PK of #__modules. But how would I proceed from here?

Any guidance would be greatly appreciated!

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Displaying FlexBanner on specific modules only

Post by Andrew998 » Mon May 12, 2014 8:57 am

As long as you have menu items you can just assign the FlexBanner module to that item as you would with any other module so you can achieve this by simply setting up multiple modules.

To actually code it into FlexBanners is a not trivial. You would need to add code to look for the menu ID but you also have to alter the backend to give you a way of chooisng the ID.

To make FlexBanner work with VM categories would be a big job.
Andrew998
Developer

tachyon
Posts: 2
Joined: Mon May 12, 2014 12:32 am

Re: Displaying FlexBanner on specific modules only

Post by tachyon » Tue May 13, 2014 5:33 am

Andrew998 wrote:
> As long as you have menu items you can just assign the FlexBanner module to
> that item as you would with any other module so you can achieve this by
> simply setting up multiple modules.

I'm aware of this, however this would mean creating multiple individual modules for each menu item. This would probably be manageable for a small list of categories, but it could be very time-consuming to create for a huge list of categories. (Although I could probably write a sql script to update the tables in one go)

>
> To actually code it into FlexBanners is a not trivial. You would need to
> add code to look for the menu ID but you also have to alter the backend to
> give you a way of chooisng the ID.
>
> To make FlexBanner work with VM categories would be a big job.

Well, seems like I have my work cut out for me. Thanks for your suggestion, though.

Post Reply