Jump to content

Custom Link

Featured Replies

Posted

I want to add custom links to this part


custom_links_01.thumb.jpg.e4430cd8192040

On 3.4.7 it was easy. Can someone tell me maybe where i have to add the code here.

Many Thanks :D

 

Do you own IP.Pages? You can add custom links and other menuitems in the menu manager....

  • Author

No i don´t. On 3.4.7 i simply add the links code to the globalTemplate on the Skinset "Editing Set" part.

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.

You can also use following feature to add a Link: ACP  => System => General Configuration => "Add a custom link to navigation bar"

  • Author

Wow this is cool :tongue:

Many Thanks Daniel and Andrej  :grin:

  • Author

Worked pretty good Andrej  :tongue:

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

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>
  • Author

Many Thanks Ahmad  :grin:

  • Author

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

  • No registered users viewing this page.