Jump to content
Spen

Adding external link to main navigation

Recommended Posts

Hello there,

Is it possible to add an external link to the main menu?

This would be the site we would like to add this to?

Regards,

Spencer

Share this post


Link to post
Share on other sites

Which "main menu"? In your frontend-template, or in the backend?

Share this post


Link to post
Share on other sites

I use the following to get a redirect in the frontend to url outside of processwire, in my case to my shopping cart which is not part of processwire, but it can be any url as you can see below.

What I did was add a page that uses a redirect template to the outside url

1- I made a template called redirect.php

In the template I have this code:

<?php 
$url = "https://www.xxx.xx/";
$session->redirect($url);
?>

2 - I added a page which uses the redirect template on the same level as the other pages that appear in the main menu.

Works like a charm for me.

Share this post


Link to post
Share on other sites

You could also use either of these methods/modules:

  1. Module Menu Builder - create custom menus, including external links. You decide what will be in it.
  2. Module Jumplinks - just create the pages you want and create redirects within Jumplinks (/old/path -> https://wherever.test/). It's easier and it handles more than redirects - like 404s and counts every click on your redirects.
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...