unicef / iogt

BSD 2-Clause "Simplified" License
25 stars 36 forks source link

Remove "View Live" for banners #348

Open geoo89 opened 3 years ago

geoo89 commented 3 years ago

Banners cannot be viewed standalone, but in the admin view they still have a "View LIVE" button, which gives a 404. This button should be disabled.

sheralim012 commented 1 year ago

Wagtail has the ability to hide the preview button on the page

Screenshot 2023-01-18 at 1 19 32 PM Screenshot 2023-01-18 at 1 24 08 PM

Hiding the "View Live" button isn't supported but there is a simple (not ideal) way that is to override templates. This will cause issues when we upgrade wagtail version. Another possible solution is to keep the live button and specify a simple template that explains that this page isn't viewable or something like that.

CC: @ChrisMarsh82 @istride

istride commented 1 year ago

Why can't banners be viewed standalone?

Banners have been implemented as a Wagtail Page, so it seems reasonable that it should be possible to view them on their own. It feels as though we are not working in a Wagtail-friendly manner on this and if we keep fighting against Wagtail it will only lead to further problems in the future.

sheralim012 commented 1 year ago

It's not just about banners but other pages used as containers as well e.g., Banner Index Page, Section Index Page, Poll Index Page etc. When the project started the first suggestion was to use snippets for these kinds of pages but they lack draft and versioning features so we opted for wagtail pages in the end. Also, these pages have no meaning for the public site on their own so that's why it was suggested to hide away this functionality. My second suggestion was to use some common template to convey info about these kinds of pages to keep aligned with wagtail way and get the somewhat same result without introducing problems for the future.