Add Shortcut Tabs - Xenforo 2

Add Shortcut Tabs - Xenforo 2

UnstucK

Administrator

Staff member
Vip Member
Reputation: 100%
Reaction score
48
Points
55
1- Create a template that you name as you wish (I named it tab)

Copy/paste this code:

HTML:
<div class="header-container">
     <div class="header-column">
  <a href="http://................." class="hov">
<div class="flex">
     <div class="onglet-l">
  <img class="max" src="https://i.goopics.net/iy1767.png">
</div>
<div class="onglet-r">
  Forums<br><b>Principale</b>
     </div>
   </div>
  </a>
</div>
     <div class="header-column">
  <a href="http://..............." class="hov">
<div class="flex">
     <div class="actu-l">
  <img class="max" src="https://i.goopics.net/nbfqsi.png">
 </div>
<div class="actu-r">
  Forums<br><b>Générale</b>
    </div>
   </div>
  </a>
</div>
<div class="header-column">
  <a href="https://.........." class="hov">
<div class="flex">
     <div class="art-l">
  <img class="max" src="https://i.goopics.net/db9nw2.png">
 </div>
<div class="art-r">
  Forums<br><b>Addon Xenforo</b>
     </div>
    </div>
   </a>
</div>
<div class="header-column">
  <a href="https://.............." class="hov">
<div class="flex">
     <div class="blocu-l">
  <img class="max" src="https://i.goopics.net/y7hxt1.png">
 </div>
<div class="blocu-r">
  Forums<br><b>Question</b>
    </div>
   </div>
  </a>
</div>
<div class="header-column">
  <a href="https://................" class="hov">
<div class="flex">
     <div class="suppor-l">
  <img class="max" src="https://i.goopics.net/fyw1cb.png">
 </div>
<div class="suppor-r">
  Forum<br><b>Tous supports</b>
    </div>
   </div>
  </a>
 </div>
</div>
    <style>
    .header-container {
    display: flex;
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    background: #fefefe;
    border-top: 1px solid #dfdfdf;
    border-left: 1px solid #d8d8d8;
    border-right: 1px solid #d8d8d8;
    border-bottom: 1px solid #d8d8d8;
    border-radius: 4px;
}
.header-column {
    flex: 1;
    overflow: hidden;
    text-align: center;
}
.flex {
    display: flex;
    width: 100%;
    padding: 6px;
}
        .max {
    max-width: 40px;
}
        img {
    max-width: 100%;
    height: auto;
}
        img {
    border-style: none;
}
.onglet-l {
    flex: 1;
    border: 1px solid #b3b3b3;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    background: #D9D9D9;
    padding: 6px 0 4px 0;
}
.onglet-r {
    flex: 3;
    border: 1px solid #b3b3b3;
    border-left: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background: #E6E6E6;
    padding: 4px 4px 0 4px;
    color: #404040;
    font-size: 16px;
}
        .actu-l {
    flex: 1;
    border: 1px solid #eb9393;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    background: #f7d4d4;
    padding: 6px 0 4px 0;
}
        .actu-r {
    flex: 3;
    border: 1px solid #eb9393;
    border-left: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background: #fbeaea;
    padding: 4px 4px 0 4px;
    color: #c52626;
    font-size: 16px;
}
        .art-l {
    flex: 1;
    border: 1px solid #80bdff;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    background: #cce5ff;
    padding: 6px 0 4px 0;
}
        .art-r {
    flex: 3;
    border: 1px solid #80bdff;
    border-left: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background: #e6f2ff;
    padding: 4px 4px 0 4px;
    color: #0059b3;
    font-size: 16px;
}
        .blocu-l {
    flex: 1;
    border: 1px solid #ffca80;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    background: #ffeacc;
    padding: 6px 0 4px 0;
}
        .blocu-r {
    flex: 3;
    border: 1px solid #ffca80;
    border-left: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background: #fff4e5;
    padding: 4px 4px 0 4px;
    color: #aa6709;
    font-size: 16px;
}
        .suppor-l {
    flex: 1;
    border: 1px solid #29e31c;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    background: #bff7bb;
    padding: 6px 0 4px 0;
}
        .suppor-r {
    flex: 3;
    border: 1px solid #29e31c;
    border-left: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background: #eafce8;
    padding: 4px 4px 0 4px;
    color: #1ea112;
    font-size: 16px;
}
    </style>

- 2 In your template: PAGE_CONTAINER search:

Code:
<!--XF:EXTRA_OUTPUT-->

- 3 Add below:
<xf:include template="onglet" />

Result:

Add Shortcut Tabs  Xenforo 2-1.png


If you prefer without the white outline change : .header-containe

By this code:

Less:
.header-container {
    display: flex;
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

Result :

Add Shortcut Tabs  Xenforo 2-2.png


Change links and titles to your liking:

Add Shortcut Tabs  Xenforo 2-3.png


To remove the display on mobile add this code in extra.less:

Less:
@media (max-width: 650px) {
.header-container .header-column {
    display: none;
 }
}
 
Back
Top