David N. Posted April 26, 2022 Posted April 26, 2022 I need a sidebar in order for ads to be automatically displayed in the sidebar. However the only way I've found to create a sidebar is to open the builder and create a small widget (a small text widget). Now I have my small text widget and the ads automatically shows up below. But I would prefer to not have that small text widget at all. Is there a solution? Thanks!
Jim M Posted April 26, 2022 Posted April 26, 2022 You will want to enable "Force sidebar to display" in ACP -> System -> Advertisements -> Advertisement Settings. This will show your advertisements which are in the sidebar even if there are not any blocks in the sidebar.
David N. Posted April 26, 2022 Author Posted April 26, 2022 (edited) Thank you, however that did not work as expected unfortunately. First, the sidebar ad is stuck to the content on its left with no padding, unlike a real sidebar. Second, the sidebar ad that is supposed to turn into a sticky ad (stays in place while scrolling down) once it reaches the top of the viewport, completely disappears when you scroll down (and the forum content becomes full width again). Edited April 26, 2022 by Jamynee
Jim M Posted April 26, 2022 Posted April 26, 2022 9 minutes ago, Jamynee said: Second, the sidebar ad that is supposed to turn into a sticky ad (stays in place while scrolling down) once it reaches the top of the viewport, completely disappears when you scroll down (and the forum content becomes full width again). You would need to contact your advertisement provider for assistance with this. Unfortunately, this is a feature of the ad, not our software. It may be, it needs to be implemented somewhere special. 9 minutes ago, Jamynee said: First, the sidebar ad is stuck to the content on its left with no padding, unlike a real sidebar. I am unable to reproduce this so you will also want to check your theme and advertisement. Here is a screenshot of the padding I am seeing which is normal with anything in the sidebar. David N. 1
David N. Posted April 26, 2022 Author Posted April 26, 2022 Thank you Jim. The reason I was thinking this may be an issue with Invision was because once I add a widget (any widget), everything behaves as expected, both the sicky part, and the padding part:
Jim M Posted April 26, 2022 Posted April 26, 2022 4 minutes ago, Jamynee said: Thank you Jim. The reason I was thinking this may be an issue with Invision was because once I add a widget (any widget), everything behaves as expected, both the sicky part, and the padding part: You would need to contact your advertisement provider and ensure that the requirements are being met. It could be the advertisement requires something which is being fulfilled by the block above being there. I'm afraid, we are unable to provide assistance to third party scripts. David N. 1
David N. Posted April 26, 2022 Author Posted April 26, 2022 Ok great, thanks Jim, I appreciate it, and I will contact my ad provider. I will update this thread once I find the answer.
Solution Morrigan Posted April 27, 2022 Solution Posted April 27, 2022 If you have pages you could try adding a custom block with an empty div in it. David N. 1
Nathan Explosion Posted April 27, 2022 Posted April 27, 2022 This post was recognized by Marc! "I'm sure others will find this helpful too :)" Nathan Explosion was awarded the badge 'Helpful' and 10 points. When the sidebar is displayed normally, this is what contains all the widgets within it: <div id="ipsLayout_sidebar" class="ipsLayout_sidebarright " data-controller="core.front.widgets.sidebar"> <div class="cWidgetContainer " data-controller="core.front.widgets.area" data-role="widgetReceiver" data-orientation="vertical" data-widgetarea="sidebar"> <ul class="ipsList_reset"> [EACH WIDGET THEN HAS ITS OWN <li></li>] </ul> </div> </div> When the advertisement is set to be shown in the sidebar is used, the ad is displayed in the sidebar as follows: <div data-role="sidebarAd">TEST</div> <br> <br> <div id="ipsLayout_sidebar" class="ipsLayout_sidebarright " data-controller="core.front.widgets.sidebar"> <div class="cWidgetContainer " data-controller="core.front.widgets.area" data-role="widgetReceiver" data-orientation="vertical" data-widgetarea="sidebar"> <ul class="ipsList_reset"> [EACH WIDGET THEN HAS ITS OWN <li></li>] </ul> </div> </div> And then when there are no widgets and the advertisment setting to force sidebar is used, you just get this: <div data-role="sidebarAd">TEST</div> <br> <br> If you really are not going to have any widgets displayed, then maybe make this the code for the advertisment instead: <div id="ipsLayout_sidebar" class="ipsLayout_sidebarright">TEST</div> David N. 1
David N. Posted May 2, 2022 Author Posted May 2, 2022 On 4/27/2022 at 6:08 PM, Morrigan said: If you have pages you could try adding a custom block with an empty div in it. Great! I did that and it works! Thanks a lot for the simple idea. And thank you too @Nathan Explosionfor the detailed code, I'm sure this will come in handy at one time or another, I appreciate the help as well.
Recommended Posts