Hey there, I'm currently working on Devaon's templates. Don't mind the incoherent stuff. Thanks !
Welcome to Devaon

Back to thread listThread messages navigation

Adds a navigation to each of your threads that lists each postof the current page (only) and allows you to jump to any of them.


Thread messages navigation GvWBLe2 Thread messages navigation 7TWLxCd

In the viewtopic_body template, add the following code at the beginning of the template:
Code:
<postnav class="container">
  <postnav class="title">Thread navigation</postnav>
</postnav>
<postnav class="--button"><img src="https://i.imgur.com/XNUHwwq.png" /></postnav>

In the same template, find
Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
and replace it with
Code:
<div style="position: relative; top: -30px; width: 1px;" class="post--id" id="{postrow.displayed.U_POST_ID}"></div>


At the end of the template, add the following code aswell:
Code:
<script type="text/javascript">
$('postnav.--button').on('click', function() {
  $('postnav.container').toggleClass('trsoff');
  $(this).toggleClass('trsoff');
});
  
$(function() {
$('div.post').each(function() {
  var $plink = $(this).find('h2.topic-title a').attr('href');
  var $pauth = $(this).find('.postprofile-name a').html();
  var $pid = $(this).find('.post--id').attr('id');
  var str = $(this).find('.postbody .content div').text();
  var $length = '32';
  var $preview = str.substring(0,$length);


$('postnav.container').append('<a class="post--ref" href="' + $plink + '">' + $pauth + ' - Message # ' + $pid + '<br /><postnav class="preview">' + $preview + '...</postnav></a>');
  });
}, 500);</script>

You can customize the number of characters of the previews to show by changing the number 32 in the
Code:
var $length = '32';
part with the number of your choice.

CSS:
Code:
postnav.container {
    background-color: white;
    position: fixed;
    right: 0;
    top: 30vh;
    width: 20vw;
    z-index: 999;
    height: 30vh;
    padding: 1%;
    box-sizing: border-box;
    transform: translateX(19vw);
    transition: all .5s ease-in-out;
}

a.post--ref {
    display: block;
    margin: 10px 0;
    font-size: 9.5pt;
    color: #454545;
    font-family: Arial, sans-serif;
    opacity: .8;
    transition: all .5s ease-in-out;
}

postnav.title {
    text-align: center;
    display: block;
    font-size: 13pt;
    border-bottom: 1px solid #15151515;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

postnav.preview {
    color: #858585;
    font-size: 9pt;
}

a.post--ref:hover {
    opacity: 1;
}

postnav.--button {
    background-color: white;
    position: fixed;
    right: 20vw;
    top: 30vh;
    z-index: 999;
    height: 30vh;
    padding: 1%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    transform: translateX(20vw);
    cursor: pointer;
    transition: all .5s ease-in-out;
}

postnav.--button img {
    width: 13pt;
}

.notrsf {
    transform: none !important;
}
Saturday, May 7th 2022
- Updated the forum version of it, which was the wrong one.