Responsive Banners - Advertisement Management
Re: Responsive Banners
Thanks. Understood. I see what you mean. I’m using the code exactly as you gave it to me though. Is there perhaps anything missing on my end from the code that might cause it to show on the site?
But it’s working. It isn’t acting as text. It’s acting as code and getting rid of all the gaps and margins.
When you did the preview you didn’t see it?
But it’s working. It isn’t acting as text. It’s acting as code and getting rid of all the gaps and margins.
When you did the preview you didn’t see it?
-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
Nope. Your board's not live?
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
-
- Customisations Team Leader
- Posts: 18489
- Joined: Thu Jan 06, 2005 1:30 pm
- Location: Fishkill, NY
- Name: David Colón
Re: Responsive Banners
Sorry, not at the moment. But I’ll play with it a bit more. Maybe I’ll be able to figure it out. Is there perhaps something else the style needs to be wrapped in? Like Head or something like that perhaps?
-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
Got it. Needed to be
<style=
and not <style>
-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
This is how we implemented responsive banners. Just placed this into the code section of the advert:
It does mean you need at least 3 versions of the banner artwork - but is an easy implementation.
Code: Select all
<A href="http://www.xyz.com/"{COUNT_CLICK}>
<picture>
<source media="(min-width: 1400px)" srcset="adimage/980Advert.png">
<source media="(min-width: 800px)" srcset="adimage/728Advert.png">
<source media="(min-width: 400px)" srcset="adimage/400Advert.png">
<img src="adimage/728Advert.png" alt="IfItDoesntMatchAnyMedia">
</picture>
-
- Registered User
- Posts: 201
- Joined: Wed Nov 12, 2003 7:11 am
- Location: Port Elizabeth - South Africa
Re: Responsive Banners
I combined some of the code in this thread for use on my site, but I am still having display issues.
How can we totally eliminate the grey space around the ad? Also, why doesn't it center in the box on mobile? (See screen shots.)
My site: https://www.manontime.com
Code I am using:
Desktop:
Mobile:
Thank you.
How can we totally eliminate the grey space around the ad? Also, why doesn't it center in the box on mobile? (See screen shots.)
My site: https://www.manontime.com
Code I am using:
Code: Select all
<style=
.ad_banner {
margin: 0;
padding: 0;
border: 0;
}
</style>
<div class="ad_banner">
<A href="https://www.riveredgejewelers.com/" target="_blank"{COUNT_CLICK}>
<picture>
<source media="(min-width: 1400px)" srcset="https://www.manontime.com/banners/980Advert.png"alt="River Edge Jewelers" width="100%">
<source media="(min-width: 800px)" srcset="https://www.manontime.com/banners/728Advert.png"alt="River Edge Jewelers" width="100%">
<source media="(min-width: 400px)" srcset="https://www.manontime.com/banners/400Advert.png"alt="River Edge Jewelers" width="100%">
<img src="https://www.manontime.com/banners/980Advert.png"alt="River Edge Jewelers" width="100%">
</picture>
</div>
-
- Registered User
- Posts: 2
- Joined: Fri Dec 21, 2018 8:16 pm
- Name: Matt
Re: Responsive Banners
Thank you for this.skybound wrote:This is how we implemented responsive banners. Just placed this into the code section of the advert:
It does mean you need at least 3 versions of the banner artwork - but is an easy implementation.Code: Select all
<A href="http://www.xyz.com/"{COUNT_CLICK}> <picture> <source media="(min-width: 1400px)" srcset="adimage/980Advert.png"> <source media="(min-width: 800px)" srcset="adimage/728Advert.png"> <source media="(min-width: 400px)" srcset="adimage/400Advert.png"> <img src="adimage/728Advert.png" alt="IfItDoesntMatchAnyMedia"> </picture>
So if I understand you correctly, I would need to create one ad banner each at 1400px, 800px, and 400px? - Yes, that would be very easy.
The code part has me a bit confused though.
At the moment we are using the following:
Code: Select all
<style=
.my_ad_banner {
margin: 0;
padding: 0;
border: none;
display: block;
}
</style>
<div class="my_ad_banner">
<a href="https://ad-link-here.com"><img src="https://our-site.com/images/phpbb_ads/xxxxxxxxxxxx.jpg" width="100%"/></a>
</div>
Code: Select all
<style=
.my_ad_banner {
margin: 0;
padding: 0;
border: none;
display: block;
}
</style>
<div class="my_ad_banner">
<A href="https://ad-link-here.com"{COUNT_CLICK}>
<picture>
<source media="(min-width: 1400px)" srcset="adimage/980Advert.png">
<source media="(min-width: 800px)" srcset="adimage/728Advert.png">
<source media="(min-width: 400px)" srcset="adimage/400Advert.png">
<img src="adimage/728Advert.png" alt="IfItDoesntMatchAnyMedia">
</picture>
https://our-site.com/images/phpbb_ads/
and title them 980Advert.png, 728Advert.png, and 400Advert.png?Lastly, I am not sure what the advantage is of having the 3 different sized banner files because the
width="100%"
code we are using now automatically resizes the single 1400px file to fit any screen width resolution. Are there any other advantages to having the 3 different banner sizes?The only problem we have right now is that on a mobile device the ads don't actually show 100% edge to edge on the mobile device screen when running our site using the mobile responsive version of the style we are using.
As it is now, the ads only fill up about 90% of the screen width. We tried playing around with different width percentages and the problem is the same. We can't seem to fix it with code.
If we could figure out how to get the ads on mobile devices to stretch edge to edge to 100% on the screen like the rest of the site does on a mobile device in our responsive style then we would be really happy with the way our ads are displaying now. Is there perhaps any way to get the ads to stretch to 100% of the screen on a mobile device instead of only around 90%?
Many thanks again.
-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
I had a quick look at your site.ManOnTime wrote:I combined some of the code in this thread for use on my site, but I am still having display issues.
How can we totally eliminate the grey space around the ad? Also, why doesn't it center in the box on mobile? (See screen shots.)
My site: https://www.manontime.com
Thank you.
The grey space is part of the framing layout of your site's Style when you have blank area. What color would you expect it to be when you have so much empty space around the small PNG file?
Yes, I see it is not centered on mobile. It is in the middle, but it is top justified. I am not sure if this will work, but try changing the code to:
Code: Select all
margin: 0;
padding: 0;
border: none;
display: block;
I just tried this whole thing on our site with the 3 different banner sizes. I didn't see any benefit. The ads still don't load edge to edge on a mobile. I only get about 90%-95% edge to edge, same as before. Also, I can't get the largest sized banner to load on a 1920x1080 screen. I tried changing min-width to 1920px, but it didn't change anything.Center this ad automatically:
Set to yes to let this extension center your ad automatically. If this leads to undesired results, use CSS directly in the code to center your ad accordingly.
So for now I am back to using just one 1700px banner with the
width="100%"
setting, which loads correctly for all screen sizes.-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
Our implementation only requires what was in my post and not the rest of the code. That is another implementation. Don't use both implementations together.CGI1984 wrote:Thank you for this.skybound wrote:This is how we implemented responsive banners. Just placed this into the code section of the advert:
It does mean you need at least 3 versions of the banner artwork - but is an easy implementation.Code: Select all
<A href="http://www.xyz.com/"{COUNT_CLICK}> <picture> <source media="(min-width: 1400px)" srcset="adimage/980Advert.png"> <source media="(min-width: 800px)" srcset="adimage/728Advert.png"> <source media="(min-width: 400px)" srcset="adimage/400Advert.png"> <img src="adimage/728Advert.png" alt="IfItDoesntMatchAnyMedia"> </picture>
So if I understand you correctly, I would need to create one ad banner each at 1400px, 800px, and 400px? - Yes, that would be very easy.
The code part has me a bit confused though.
At the moment we are using the following:
So we would need to implement this code instead as follows?Code: Select all
<style= .my_ad_banner { margin: 0; padding: 0; border: none; display: block; } </style> <div class="my_ad_banner"> <a href="https://ad-link-here.com"><img src="https://our-site.com/images/phpbb_ads/xxxxxxxxxxxx.jpg" width="100%"/></a> </div>
And then we would need to upload the 3 ad banner files toCode: Select all
<style= .my_ad_banner { margin: 0; padding: 0; border: none; display: block; } </style> <div class="my_ad_banner"> <A href="https://ad-link-here.com"{COUNT_CLICK}> <picture> <source media="(min-width: 1400px)" srcset="adimage/980Advert.png"> <source media="(min-width: 800px)" srcset="adimage/728Advert.png"> <source media="(min-width: 400px)" srcset="adimage/400Advert.png"> <img src="adimage/728Advert.png" alt="IfItDoesntMatchAnyMedia"> </picture>
https://our-site.com/images/phpbb_ads/
and title them 980Advert.png, 728Advert.png, and 400Advert.png?
Lastly, I am not sure what the advantage is of having the 3 different sized banner files because thewidth="100%"
code we are using now automatically resizes the single 1400px file to fit any screen width resolution. Are there any other advantages to having the 3 different banner sizes?
The only problem we have right now is that on a mobile device the ads don't actually show 100% edge to edge on the mobile device screen when running our site using the mobile responsive version of the style we are using.
As it is now, the ads only fill up about 90% of the screen width. We tried playing around with different width percentages and the problem is the same. We can't seem to fix it with code.
If we could figure out how to get the ads on mobile devices to stretch edge to edge to 100% on the screen like the rest of the site does on a mobile device in our responsive style then we would be really happy with the way our ads are displaying now. Is there perhaps any way to get the ads to stretch to 100% of the screen on a mobile device instead of only around 90%?
Many thanks again.
The advantage of have 3 differing banner sizes is to ensure you make the best use of the platform you are serving to as opposed to just scaling a single graphic.
-
- Registered User
- Posts: 201
- Joined: Wed Nov 12, 2003 7:11 am
- Location: Port Elizabeth - South Africa
Re: Responsive Banners
@skybound - Thanks.
I tried the code exactly as you have it. For some reason it makes the space for the ad on our site, but doesn't load the ad on our site when on a desktop computer.
On a mobile device it loads the add at full size and it goes way beyond the bounding area of the responsive mobile style. This was the same problem we had before on mobile devices and why we implemented
The only issue I was hoping to rectify was to be able to get my ads to stretch to 100% on a mobile device instead of only 90%-95%, but this doesn't appear to be a solution, so we are back to what we were using before, which works fine in every other way. Why though
I tried the code exactly as you have it. For some reason it makes the space for the ad on our site, but doesn't load the ad on our site when on a desktop computer.
On a mobile device it loads the add at full size and it goes way beyond the bounding area of the responsive mobile style. This was the same problem we had before on mobile devices and why we implemented
width="100%"
The only issue I was hoping to rectify was to be able to get my ads to stretch to 100% on a mobile device instead of only 90%-95%, but this doesn't appear to be a solution, so we are back to what we were using before, which works fine in every other way. Why though
width="100%"
only gives me 90%-95% on a mobile device still remains a mystery.-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
if using the 'centered' option there's a css-class around the image and one can use css-magic like
if using e.g. leaderboard size (change size for other bannerformats). see it in action at nuforum.phpbb-ads-center img {
width: 100%;
max-width: 728px;
height: auto;
max-height: 90px;
}
-
- Registered User
- Posts: 3
- Joined: Fri Jun 26, 2020 4:15 pm
Re: Responsive Banners
I am trying to get my ads to open in new tab or window. I have added
target="_blank"
to the URL link, but it isn't working, any ideas please if thee is another way perhaps?-
- Registered User
- Posts: 203
- Joined: Thu Feb 20, 2020 8:27 am
Re: Responsive Banners
Our Solution :
add this css code in /styles/prosilver/theme/stylesheet.css
add this in you Advertisement settings zone code
and this is ALL !
add this css code in /styles/prosilver/theme/stylesheet.css
Code: Select all
.responsiveX {
max-width: 100%;
height: auto;
}
Code: Select all
<div>
<a href="https://www.YOURSITE.com/" target="_blank">
<img class="responsiveX" src="https://PATH_TO_YOUR_IMAGE.jpg" >
</a>
</div>
and this is ALL !
-
- Registered User
- Posts: 2
- Joined: Tue Apr 04, 2023 3:02 pm
Re: Responsive Banners
It is now 2024 and this update still works! That is also to say that it is 2024 and this issue still exists.CGI1984 wrote:UPDATE:I think I got it. I added the following to the end of the banner URL and this fixed it:alt="Image" width="100%"/>
.
-
- Registered User
- Posts: 46
- Joined: Thu Aug 11, 2022 9:43 pm
Re: Responsive Banners
Hi
I'm reading these posts and not getting it into my head"!
I have an image whch is linked to a googledoc when clicked.That works. I can centre the image. I've tried and tried but can;t make the image resposive to mobile screens. ANy ideas?
I'm reading these posts and not getting it into my head"!
I have an image whch is linked to a googledoc when clicked.That works. I can centre the image. I've tried and tried but can;t make the image resposive to mobile screens. ANy ideas?
-
- Registered User
- Posts: 8
- Joined: Tue Mar 07, 2023 8:12 pm