Hello M-Jay,
I have been working on the menu a bit to make it fit better to the screen when browsing on mobile devices. Would like to provide some suggestions to make this development more bootstrap compliant.
You will notice it does not show the menu correct on your phone in the default theme. The pages will run out on the right because the menu does not conform to the smaller screen size.
With the provided changes, it does. The menu is fully bootstrap compliant. It is compliant with bootstrap 4.3.1. The overrides are inside the bootstrap.css file.
Here are the changes >>
Create a folder called responsive inside the views folder:
\views\themes\responsive
\views\themes\responsive-drop << [color=rgb(26, 188, 156)]This one for the dropdown menu version[/color]
File changes are in >>
bootstrap.css (I will provide full changed in theme file)
header.php (I will provide full changed in theme file)
theme.css (I will provide full changed in theme file)
topnavbar.php (I will provide full changed in theme file)
I will explain some of the changes in the php files only, you can compare with the default theme.
[color=rgb(97, 189, 109)]
header.php[/color] changes >>
Find: [color=rgb(250, 197, 28)]
<!-- Theme css -->[/color] Just below this change:
<link rel="shortcut icon" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/default/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/default/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/default/theme.css" />
To:
<link rel="shortcut icon" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/responsive/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/responsive/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/views/themes/responsive/theme.css" />
[color=rgb(97, 189, 109)]
topnavbar.php[/color] changes >>
Find: [color=rgb(250, 197, 28)]
<!-- Start Infobar -->[/color] Above it, which should be the first 4 lines in the file, change:
<nav class="navbar navbar-expand-lg navbar-dark primary-color">
<a class="navbar-brand" href='<?php echo $site_config["SITEURL"]; ?>/index.php' title='Home' target='_self'><img
src='<?php echo $site_config["SITEURL"]; ?>/views/themes/default/images/logo.gif' alt='logo' width='212'
height='46' /></a>
To:
<nav class="navbar navbar-expand-lg navbar-dark primary-color">
The following change is made to make the text shorter, and thus fitting better on small screens.
It also requires an update to the language file.
Find:
print (T_("LOGGED_IN_AS").": ".class_user($CURUSER["username"])."");
Change to:
print (T_("HI")." ".class_user($CURUSER["username"])."");
The following will actually change the menu layout >>
Find: [color=rgb(250, 197, 28)]
<?php if ($CURUSER){ ?>[/color]
Below it, replace:
<div class='navigation'>
<div class='menu'>
<ul id='nav-one' class='dropmenu'>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/index.php"><?php echo T_("HOME");?></a></li>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/forums"><?php echo T_("FORUMS");?></a></li>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/torrentsupload"><?php echo T_("UPLOAD_TORRENT");?></a></li>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/torrents/browse"><?php echo T_("BROWSE_TORRENTS");?></a></li>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/torrents/today"><?php echo T_("TODAYS_TORRENTS");?></a></li>
<li><a href="<?php echo $site_config["SITEURL"]; ?>/torrentssearch"><?php echo T_("SEARCH_TORRENTS");?></a></li>
</ul>
</div>
</div>
with:
<div class="navigation">
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href='<?php echo $site_config["SITEURL"]; ?>/index.php' title='Home' target='_self'><img src='<?php echo $site_config["SITEURL"]; ?>/views/themes/u2torrents/images/logo.gif' alt='logo' width='212' height='46' /></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent1" aria-controls="navbarSupportedContent1" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
<div class="collapse navbar-collapse" id="navbarSupportedContent1">
<ul class="navbar-nav mr-auto">
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/index.php"><?php echo T_("HOME");?><span class="sr-only">(current)</span></a> </li>
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/forums"><?php echo T_("FORUMS");?></a> </li>
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/torrentsupload"><?php echo T_("UPLOAD_TORRENT");?></a> </li>
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/torrents/browse"><?php echo T_("BROWSE_TORRENTS");?></a> </li>
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/torrentssearch"><?php echo T_("SEARCH_TORRENTS");?></a> </li>
<li class="nav-item active"> <a class="nav-link" href="<?php echo $site_config["SITEURL"]; ?>/torrents/today"><?php echo T_("TODAYS_TORRENTS");?></a> </li>
</ul>
</div>
</nav>
</div>
languages/english.php changes >>
Look for:
$LANG["LOGGED_IN_AS"] = "You are logged in as";
Add below:
$LANG["HI"] = "Hi";
That's it, which is just to show the changes that are required to have a responsive menu.
You can tweak to your liking. I am still tweaking myself :-)
I will attach a complete theme for a normal responsive menu, as well as a menu with a dropdown included.
[ATTACH type="full"]5500[/ATTACH]
[ATTACH type="full"]5501[/ATTACH]