aligent / orocommerce-announcement-bundle

Site-wide announcement banners in OroCommerce
GNU General Public License v3.0
1 stars 0 forks source link

Add ability to only display Announcement on Homepage #11

Open chrisaligent opened 2 years ago

chrisaligent commented 2 years ago

At the moment Announcements are displayed on all pages.

It should be possible (via a new Configuration option) to set an Announcement to only appear on the Homepage.

This could potentially be implemented by cloning the layout YAML into oro_frontend_root, and adding a condition to both layouts so that oro_frontend_root is only displayed if onlyOnHomepage=true and page is only displayed if onlyOnHomepage=false.

Or alternatively it may be possible to modify getDisplayStatus in the Layout DataProvider to check the current URL and configuration and handle this logic itself, this would remove the need for duplicate code and would be unit-testable.