Versatile Banner

this broke on the latest discourse version udpdate and no longer can show images as a background

Hi all,

Please forgive my ignorance, but I noticed that there are css options to have this component display for either anon, members, or both.

I would like to add a custom group as an option since I plan to use the banner as advertisement space. Paid members will be a part of an “ad-free / non-versatile banner” group, opposed to non-paid (regular), and anon users will be presented the versatile banner.

I assume css additions in the theme component customization area is the correct way to go about this once I create the group, but any guidance is appreciated.

I do not know enough to ask my question better than that.

Thanks

Hmm… if you want to target those groups, then perhaps you should use:

And hide the ads using CSS, if that’s your plan.

2 Likes

The house ads feature of the discourse advertising plugin allows you to exclude groups from seeing those ads. Maybe you can use that for showing ads instead of hiding the versatile banner based on the users groups.

5 Likes

Just a heads-up about changes to Ingur access from the UK which is affecting this TC.

I’ve just installed Versatile Banner on a new site, I have it running on other sites but this is the first ‘new install’ for a while, so it’s the first time I’ve seen the unconfigured default view of VB.

The default image background Versatile Banner is a link to Imgur, but unfortunately Imgur content is now completely inaccessible in the UK. I think this may be because of mandatory age-checking legislation that was introduced here, but I’m not sure.

So on first installation the Versatile Banner looks like this in the UK

I can confirm that spoofing my origin using a VPN fixes the image access issue.

It might be worth changing the default image to something GitHub-hosted? Could be in the VB repo? Or otherwise another hosting source which is not blocked in the UK.

5 Likes

Thanks for pointing this out! We shouldn’t be linking to an external image host here, I’m surprised it continued working for so long. That image has quite a lot of views, thanks imgur!

Time to move on… once merged this is going to migrate the image to be sourced within the theme directly. It also adds some optional upload settings if you don’t want to supply a URL. Existing background image settings should remain unchanged after this update.

https://github.com/discourse/discourse-versatile-banner/pull/67

6 Likes

Hi, I noticed that changing the cookie name doesn’t cause the banner to re-appear as per the help text. I have tweaked code in versatile-banner.gjs around line 25/26 which resolves it and causes the banner to reappear if the cookie name is changed. Not sure if this is the best way. (Sorry I don’t have the github setup to create fork/pull)

Thanks

  cookieClosed = cookie("banner_closed");
  cookieClosed = (this.cookieClosed && JSON.parse(this.cookieClosed).name == settings.cookie_name)
    ? this.cookieClosed
    : null;
  cookieCollapsed = cookie("banner_collapsed");
  cookieCollapsed = (this.cookieCollapsed && JSON.parse(this.cookieCollapsed).name == settings.cookie_name)
    ? this.cookieCollapsed
    : null;
2 Likes

Thanks for the report! I’ve just made an update available that gets cookies back in working order, let us know if you have any further trouble with it

5 Likes

Thanks - tested and appears to work correctly.

2 Likes