XF 2.0 Sticky sidebar

Kleazy

Active member
Trying to make the sidebar sticky so when scrolling vertically the sidebar never shows emptiness.
There used to be a plugin or two that are no more... and I see it as a feature in a few of the styles for sale in the resource section.

Can someone help me turning my current (close to default) style into a sticky sidebar?
 
Trying to make the sidebar sticky so when scrolling vertically the sidebar never shows emptiness.
There used to be a plugin or two that are no more... and I see it as a feature in a few of the styles for sale in the resource section.

Can someone help me turning my current (close to default) style into a sticky sidebar?
i am also looking for this solution. Can someone help?

If XF makes all its widget configurable for stickiness it'd be awesome.
 
If I understood what you meant, go to

Appearance -> Styles -> Your style - proprieties -> Sidebar -> Sticky Sidebar (check box)
Thanks for the help...but the default style that ships with my xf does not have "sidebar" as an option inside the style properties.... maybe thats a function of some custom themes?
 
Add extra.less;
CSS:
.p-body-sidebar {display: table-cell !important}
Open the template to constrain the widget Add id = "name" or class = "name" to the first div
Open the helper_js_global template and end the js template </ xf: macro>
JavaScript:
<script>if ($(window).width() > 768) {
$('.p-body-sidebar #name').stick_in_parent({parent: '.p-body-main', spacer: '.p-body-sidebar', offset_top: 60});
}</script>
Note: The offset_top can be customized to match the tempo.
 
PAGE_CONTAINER search in template
PHP:
            <xf:if is="$sidebar">
                <div class="p-body-sidebar">
                    <xf:ad position="container_sidebar_above" />
                    <xf:foreach loop="$sidebar" value="$sidebarHtml">
                        {$sidebarHtml}
                    </xf:foreach>
                    <xf:ad position="container_sidebar_below" />
                </div>
            </xf:if>
change
PHP:
            <xf:if is="$sidebar">
                <div class="p-body-sidebar">
                <div id="sidebar">
                    <xf:ad position="container_sidebar_above" />
                    <xf:foreach loop="$sidebar" value="$sidebarHtml">
                        {$sidebarHtml}
                    </xf:foreach>
                    <xf:ad position="container_sidebar_below" />
                </div>
                </div>
            </xf:if>
search;
PHP:
    <xf:include template="google_analytics" />
change
PHP:
    <xf:js src="js/xFDestek/SabitSidebar/jquery.lockfixed.js" />
    <xf:js src="js/xFDestek/SabitSidebar/jquery.lockfixed.min.js" />
helper_js_global search in template
PHP:
        </script>
    </xf:if>
</xf:macro>
change;
PHP:
        </script>
    </xf:if>
<script>
    if ($(window).width() > 768) {
        $(document).ready(function () {
             $.lockfixed("#sidebar", {offset: {top: {$xf.options.sticky_sidebar_offset_top}, bottom: {$xf.options.sticky_sidebar_offset_bottom}} });
});
    }
</script>
</xf:macro>
Upload zip file in the forum ftp main directory ;)
Good work! (y)

Demo; https://xfdestek.com:giggle::coffee:
 

Attachments

Back
Top Bottom