Making a sticky sidebar only at viewtopic

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
Registered User
Posts: 29
Joined: Mon Sep 12, 2016 9:44 pm

Making a sticky sidebar only at viewtopic

Post by Satusnovus » Tue Jul 31, 2018 7:04 pm

I'm looking for a nice solution to make a sticky sidebar and only for the viewtopic pages. With a nice solution I mean a solution without much code and no external scripts.

I would like a sidebar at the left of my viewtopic pages that will be sticky when you scroll down. I don't want to show it at mobile devices or tablets and only for a screen width of +/-1000px or more to avoid problems.

I'm not sure if it could be done with an extension or if an extension would be better than changing code. Thanks in advance.

Edit: I'm not sure if this solution is sticky and only for viewtopic pages: viewtopic.php?f=481&t=2317541&hilit=sidebar#p14085556

User avatar
Jr. Style Validator
Posts: 1000
Joined: Fri Dec 12, 2008 9:08 pm
Location: Manchester, UK

Re: Making a sticky sidebar only at viewtopic

Post by eeji » Tue Jul 31, 2018 7:57 pm

To use it only in view topic pages you can wrap your code in

Code: Select all

<!-- IF SCRIPT_NAME = viewtopic -->
	Your code here
<!-- ENDIF -->
A media query would take care of only showing at certain screen sizes.

I know you said no external scripts, but making it sticky would be difficult without. I can highly recomend "Sticky-Kit", a jQuery plugin that weighs in at just just over 3kb minified, and phpBB loads jQuery already. I use this in one of my styles and found it really easy to use. More info here:

User avatar
Registered User
Posts: 13294
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco

Re: Making a sticky sidebar only at viewtopic

Post by 3Di » Tue Jul 31, 2018 9:13 pm

eeji wrote:
Tue Jul 31, 2018 7:57 pm
I can highly recomend "Sticky-Kit"
Nice one, I will use it for sure. Thank you :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
The new Dice Roller extension for phpBB 3.2 :game_die:
Extensions, Scripts, MOD porting, Update/Upgrades

Post Reply

Return to “[3.2.x] Styles Support & Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests