Forum Shortcuts

XF 2.2 Forum Shortcuts

Add-on xenforo 2

Ressources et modules complémentaires pour XenForo 2

Styles xenforo 2

Styles / Thèmes et apparence pour xenforo 2

Templates xenforo 2

Codes pour modifier les templates sur xenforo 2

Section Premium

Add-on et Styles pour membre Premium
Forum Shortcuts

XF 2.2 Forum Shortcuts

Catégorie Catégorie Modifications Templates
Titre du sujet Titre du sujet Forum Shortcuts
Auteur de la discussion Auteur de la discussion laurent68
Date de début Date de début
Réponses Réponses 0
Affichages Affichages 185
Réaction Réaction 1
Dernier message par Dernier message par laurent68

laurent68

Fondateur

Staff
fondateur
Réputation: 100%
Discussions
4 649
Messages
12 075
Solutions
81
J'aime
7 620
Points
198
Easily create shortcuts on your forum.
Create a new template (keybord_shortcuts) and enter the code for the desired shortcuts.
Example with 3 shortcuts :

JavaScript:
<script>
      
          document.addEventListener('keydown', function(event) {
      // Check if the pressed key is the 'A' key and both the Ctrl and Alt keys are pressed
      if ((event.key === 'a' || event.key === 'A') && event.ctrlKey && event.altKey) {
        // Define the URL you want to navigate to
        let newUrl = '/index.php?account/account-details'; // Change this URL as needed

        // Navigate to the new URL
        window.location.href = newUrl;
      }
    });

    
              document.addEventListener('keydown', function(event) {
      // Check if the pressed key is the 'F' key and both the Ctrl and Alt keys are pressed
      if ((event.key === 'f' || event.key === 'F') && event.ctrlKey && event.altKey) {
        // Define the URL you want to navigate to
        let newUrl = '/index.php?'; // Change this URL as needed

        // Navigate to the new URL
        window.location.href = newUrl;
      }
    });
    
            
          document.addEventListener('keydown', function(event) {
      // Check if the pressed key is the 'H' key and both the Ctrl and Alt keys are pressed
      if ((event.key === 'h' || event.key === 'H') && event.ctrlKey && event.altKey) {
        // Define the URL you want to navigate to
        let newUrl = '/index.php?pages/home/'; // Change this URL as needed

        // Navigate to the new URL
        window.location.href = newUrl;
      }
    });

</script>

add to the end of template PAGE_CONTAINER :
PHP:
<xf:include template="keybord_shortcuts" />

If necessary, create a page with the shortcuts :
HTML:
.shortcuts {
a:link {
  text-decoration: none;
}
u {
color: #000;
}
</style>
<h2>Forum sneltoetsen</h2>.
<p>On this forum it is possible to use certain keyboard shortcuts. In combination with the [ctrl] key and the [alt] key, it is possible to go to a specific page with a third key. For this you have to press 3 keys at the same time. The overview:</p>
<ul class="shortcuts">
<li><button>ctrl</button> + <button>alt</button> + <button>a</button> = <a href="/index.php?account/account-details"><u>A</u>ccount settings</a></li>
<li><button>ctrl</button> + <button>alt</button> + <button>f</button> = <a href="/index.php"><u>F</u>orum index</a></li>
<li><button>ctrl</button> + <button>alt</button> + <button>h</button> = <a href="/index.php?pages/home/"><u>H</u>omepage</a></li>

Demo : Sneltoetsen
 
Sujets similaires Les plus vues Voir plus
Retour
Haut Bas