Menu Bar Link Mod for TNG

Steve
Posts: 79
Joined: Sun Oct 01, 2017 3:08 pm

Menu Bar Link Mod for TNG

Post by Steve » Mon Sep 02, 2019 4:08 pm

I decided to use TNG with WordPress sometime ago. All has gone reasonably well except for mobile devices, there is no easy way to get back to WordPress from TNG pages without typing in the URL again. So I created a MOD that adds a URL link in the TNG navigation menu bar. After thinking about it users might want a link for other reasons, like linking to a blog, so I changed the MOD and added modes of operation. This MOD can be used with or without a CMS (Content Management System - WordPress, joomla etc.).

TNG provides a way to add pull down menus where you can add links. If you are looking for a pull down menu check out Add Links to TNG. This MOD adds one link while pull down menus support multiple links.
 
In Mode 0 the left home button function remains unchanged and links to TNG while the new button displays CMS, by default, and will link to any URL specified in the MOD's Edit Options menu.
 
--- MODE 0 Display ---
Image
 
In Mode 1 the left home button links to the URL specified in the options while the new button links to TNG. The default text displays TNG by default.
 
--- MODE 1 Display ---
Image
 
So if you use WordPress for your home page, you can select mode 1, and enter the URL for WordPress. When users select Home the WordPress page will be loaded. If they select the new button, the TNG page will be loaded.

You can change the text that is displayed depending on which mode you use. For example in Mode 0 you can change the text for the URL link but not the home link since it is your home page.
 
--- MODE 0 Display ---
Image
 
In Mode 1 you can change the text for the TNG link but cannot change text for the home URL link text since it points to your home page.
 
--- MODE 1 Display ---
Image
 

The screen shot below shows the mobile menu, for my website, on an iPhone. Mobile devices were the primary reason I created the mod.
 
--- MODE 1 Display on iPhone ---
Image
 

The MOD includes a menubar_config.php file, located in the extensions folder, which allows modifying the menu text. All TNG languages are included the in file. Content of the menubar_config.php file is shown in the code box:

Code: Select all

<?php
	//%version:v12.0.0.1%
	// Edit the language(s) you are using to display text in the menu bar.
	// Names ending in _cms are for the URL link when using mode 0
	// Names ending in _tng are for TNG page when using mode 1
	// In either mode the home link displays the original language for the home button.
	$Afrikaans_tng = 'TNG';
	$Afrikaans_cms = 'CMS';
	$Afrikaans_UTF8_tng = 'TNG';
	$Afrikaans_UTF8_CMS = 'CMS';
	$Arabic_UTF8_tng = 'TNG';
	$Arabic_UTF8_cms = 'CMS';
	$Chinese_UTF8_tng = 'TNG';
	$Chinese_UTF8_cms = 'CMS';
	$Croatian_tng = 'TNG';
	$Croatian_cms = 'CMS';
	$Croatian_UTF8_tng = 'TNG';
	$Croatian_UTF8_cms = 'CMS';
	$Czech_tng = 'TNG';
	$Czech_cms = 'CMS';
	$Czech_UTF8_tng = 'TNG';
	$Czech_UTF8_cms = 'CMS';
	$Danish_tng = 'TNG';
	$Danish_cms = 'CMS';
	$Danish_UTF8_tng = 'TNG';
	$Danish_UTF8_cms = 'CMS';
	$Dutch_tng = 'TNG';
	$Dutch_cms = 'CMS';
	$Dutch_UTF8_tng = 'TNG';
	$Dutch_UTF8_cms = 'CMS';
	$English_tng = 'TNG';
	$English_cms = 'CMS';
	$English_UTF8_tng = 'TNG';
	$English_UTF8_cms = 'CMS';
	$Finnish_tng = 'TNG';
	$Finnish_cms = 'CMS';
	$Finnish_UTF8_tng = 'TNG';
	$Finnish_UTF8_cms = 'CMS';
	$French_tng = 'TNG';
	$French_cms = 'CMS';
	$French_UTF8_tng = "TNG";
	$French_UTF8_cms = "CMS";
	$German_tng = 'TNG';
	$German_cms = 'CMS';
	$German_UTF8_tng = 'TNG';
	$German_UTF8_cms = 'CMS';
	$Greek_UTF8_tng = 'TNG';
	$Greek_UTF8_cms = 'CMS';
	$Icelandic_tng = 'TNG';
	$Icelandic_cms = 'CMS';
	$Icelandic_UTF8_tng = 'TNG';
	$Icelandic_UTF8_cms = 'CMS';
	$Italian_tng = 'TNG';
	$Italian_cms = 'CMS';
	$Italian_UTF8_tng = 'TNG';
	$Italian_UTF8_cms = 'CMS';
	$Norwegian_tng = 'TNG';
	$Norwegian_cms = 'CMS';
	$Norwegian_UTF8_tng = 'TNG';
	$Norwegian_UTF8_cms = 'CMS';
	$Polish_UTF8_tng = "TNG";
	$Polish_UTF8_cms = "CMS";
	$PortugueseBR_tng = 'TNG';
	$PortugueseBR_cms = 'CMS';
	$PortugueseBR_UTF8_tng = 'TNG';
	$PortugueseBR_UTF8_cms = 'CMS';
	$Romanian_tng = 'TNG';
	$Romanian_cms = 'CMS';
	$Romanian_UTF8_tng = 'TNG';
	$Romanian_UTF8_cms = 'CMS';
	$Russian_UTF8_tng = 'TNG';
	$Russian_UTF8_cms = 'CMS';
	$Serbian_tng = 'TNG';
	$Serbian_cms = 'CMS';
	$Serbian_UTF8_tng = 'TNG';
	$Serbian_UTF8_cms = 'CMS';
	$Slovak_tng = 'TNG';
	$Slovak_cms = 'CMS';
	$Slovak_UTF8_tng = 'TNG';
	$Slovak_UTF8_cms = 'CMS';
	$Spanish_tng = 'TNG';
	$Spanish_cms = 'CMS';
	$Spanish_UTF8_tng = 'TNG';
	$Spanish_UTF8_cms = 'CMS';
	$Swedish_tng = 'TNG';
	$Swedish_cms = 'CMS';
	$Swedish_UTF8_tng = 'TNG';
	$Swedish_UTF8_cms = 'CMS';
?>
Text is enclosed in single quotes and the line must end with a semicolon. Edit either CMS or TNG for your language using Notepad++ or a similar editor that does not add a BOM (Byte Order Mark) character to the file. If you make a mistake, you will get a php error and TNG will not load. If this happens you can edit and correct the file or go to the TNG extensions folder and delete the menubar_config.php file and reinstall the MOD. However, you can delete any languages you are not going to use. If you uninstall the MOD the menubar_config.php file is deleted. If you decide to reinstall the MOD you will need to edit the menu file again to change the default text.

The MOD can be used regardless of the TNG installation configuration. It doesn't matter if TNG and WordPress are in separate folders or if TNG is installed in the WordPress folder. No integration between TNG and WordPress is required but if the two are integrated the MOD should install and run without issue provided there are no additional modifications, by other MODs, to genlib.php that prevents installation.

Some TNG templates do not display the menu bar on the index page. If you want to display the menu bar open the index.php file, for the template you are using, and change $flags['noicons'] from true to false.

menubar_link_v12.0.0.1.zip
Created 9/3/19
 
Version v12.0.0.1 removes a conflict with SimileTimeline
 
You do not have the required permissions to view the files attached to this post.