XF 2.0 Add a menu item for mobile view only

Mr Lucky

Well-known member
Licensed customer
Is it possible to create a menu item (main tab) that is only visible in the mobile off canvas menu?

Thanks.
 
Hi,

Create the new navigation menu. After that, enter this code in your extra.less
CSS:
.p-nav .p-nav-list li:nth-of-type(1) {display: none;}

change the number (1) by the tab number according to the order shown.

For example
CSS:
.p-nav .p-nav-list li:nth-of-type(2) {display: none;}
.p-nav .p-nav-list li:nth-of-type(3) {display: none;}
.p-nav .p-nav-list li:nth-of-type(4) {display: none;}
...


I do not know if you can change the number by the navs IDs, so if somebody knows...

regards
 
In your extra.less:

CSS:
/* for nav only in mobile */

@media only screen and (min-device-width:375px)

{.mobilesonly

    {display:none }}

In your navigation item:

View attachment 171060
Thanks for providing these instructions. I have tried them but they are not working. Do I need to create the div class first in the page container or something?
<div class="mobilesonly">
</div>
 
Back
Top Bottom