how to make a sticky ad on sidebar-below in XenForo

gumya

Well-known member
Registered
Joined
Oct 9, 2019
Messages
131
Points
53

Reputation:

Am using XenForo default template, how can i make a sticky ad on sidebar-below?
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,714
Points
823

Reputation:

1. First download and unzip the file jquery.sticky-kit.min.js attached below, copy it to the js/sticky-kit folder
2. Open the helper_js_global template, insert the following code at the bottom of the template content:
Code:
<script src="js/sticky-kit/jquery.sticky-kit.min.js"></script>
<script>
$(".stickyside").stick_in_parent({parent:".pageContent", offset_top:35});
</script>
You can edit the top alignment at the offset_top (px) option if you want to match the site interface

3. Create widgets using Widget Framework with the following structure:
Code:
<div class="stickyside">
Code widget
</div>
 

Attachments

  • jquery.sticky-kit.min.rar
    1.4 KB · Views: 98

gumya

Well-known member
Registered
Joined
Oct 9, 2019
Messages
131
Points
53

Reputation:

Is this the footer template you mentioned?
footer temp.PNG


Once I insert the JS Code into footer.less template the site start Misbehaving like this
misbehave.PNG
 
Last edited:

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,714
Points
823

Reputation:

insert it here helper_js_global
 

gumya

Well-known member
Registered
Joined
Oct 9, 2019
Messages
131
Points
53

Reputation:

Like this? It's not working, no effect at all. Can you double check please, or am i missing something?
like this.PNG
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,714
Points
823

Reputation:

@gumya I will try it again
 

gumya

Well-known member
Registered
Joined
Oct 9, 2019
Messages
131
Points
53

Reputation:

Thank you, I'll be waiting...
 

Miss98

Member
Registered
Joined
Aug 9, 2020
Messages
24
Points
23

Reputation:

1 - You don't put the script in helper_js_global
2 - Then you put this code in the template you want :

Code:
<div class="stickyside">
<xf:widget key="widget_key" />
</div>

Change the widget key
 

Miss98

Member
Registered
Joined
Aug 9, 2020
Messages
24
Points
23

Reputation:

Other solution :

In the PAGE_CONTAINER template looks for : <footer class="p-footer" id="footer">
Add above : <div class="sticky_1">Ad test sticky, this is a test ad . . . </div>

In extra.less adds :

CSS:
.sticky_1 {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  text-align: center;
  background-color: #185886;
  padding: 10px;
  font-size: 20px;
  z-index: 9999;
}
Result : http://prntscr.com/u5lqbh

If you want the ad at the top :
Change : bottom: 0; by : top: 0;
 
Top