Hi guys,
I found this post while searching on how to have the sidebar fixed.
I simply included ~ all the content of my sidebar template (essentially blog-sidebar.html.twig
) inside a
<div class="p-fixed">
...
</div>
so the file at the end was:
{% set feed_url = wiki.url == '/' or wiki.url == base_url_relative ? (base_url_relative~'/'~wiki.slug) : wiki.url %}
{% set new_base_url = wiki.url == '/' ? '' : wiki.url %}
{% set sidebar_root = header_var('sidebar_root', [page, blog, wiki]) %}
<div class="p-fixed">
{% if config.plugins.simplesearch.enabled %}
<div class="sidebar-content">
{% include 'partials/simplesearch_searchbox.html.twig' %}
</div>
...
{% if config.plugins.feed.enable_json_feed %}<a class="btn" href="{{ feed_url }}.json"><i class="fa fa-rss-square"></i> JSON</a>{% endif %}
</div>
{% endif %}
</div>
The result is not bad at all:
with the only drawback that âfixedâ is really fixed and so once the page is scrolled and the hero images is no more visible, all that space is empty:
Ciao,
Matteo