Jump to content

Custom Link


simplymesobe5280

Recommended Posts

Posted

Admin CP -> Customization -> Themes -> Edit HTML and CSS -> Navigate to core - front - global - navBar template and add the following code before the </ul> tag at the end:

 <li data-role='navItem'><a href='http://example.com'>Link A</a></li>

Then you need to edit the mobileNavigation template, so the links show in the responsive drawer as well. Find:

				{{if \IPS\Settings::i()->show_home_link}}
					<li><a href='{setting="home_url"}'>{lang="home_name_value"}</a></li>
				{{endif}}

Right after add the same code you added to the navBar template. 

88f7jXA8uxD2HPqwUjcxok3WPFn3sM.png

If you wish to only show links for specific user groups, for members who are logged in, etc, you need to use conditional statements. Here is an example:

  {{if \IPS\Member::loggedIn()->member_id}}
          <li data-role='navItem'><a href='http://example.com'>Link B</a></li>
          {{endif}}

This link will be hidden from guests.

Posted

Worked pretty good Andrej  :tongue:

Can you tell me how i make the added links open on a new tab :grin:

​Use

<li data-role='navItem'><a href='http://example.com' target='_blank'>Link A</a></li>
Posted

On 3.4.7 i added this code to open the Radio link in a popup

<script type="text/javascript">
function popup (url) {
 window = window.open(url, "Popupwindow", "width=696,height=907,resizable=yes");
 window.focus();
 return false;
}
</script>
<li class='left'><a href='http://www.oursite.com/radio.html' title='Go to Radio'target="_blank" onclick="return popup(this.href)">ARadio</a></li>

On 4.0.0. i changed it to

<script type="text/javascript">
function popup (url) {
 window = window.open(url, "Popupwindow", "width=696,height=907,resizable=yes");
 window.focus();
 return false;
}
</script>
<li data-role='navItem'><a href='http://www.oursite.com/radio.html' target="_blank"onclick="return popup(this.href)">ARadio</a></li>

Maybe  a hint  for those who want to add a popup too :D

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...