Navigate to custom portal page

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:32:52 +0000.
Sender:Kevin Holbrook.
Date:Tuesday, 1 December 2015 20:08:47 UTC.

How do you navigate to a custom portal page?
I’ve got a custom template, but there is not enough documentation to tell me how I can set up and navigate to a page using this template.
Are all pages accessed relative to the “/portal” url?
For instance “/portal/custom”.
Is the portal_page slug name used as the define in the template?
More documentation in this area would really help.
Thanks!

Imported Google Group message.
Sender:Martin Buhr.
Date:Tuesday, 1 December 2015 20:27:46 UTC.

Hi Kevin,

I’ll put this documentation requirement into our tracker for the next version - you’re right, it’s a bit weak. Will be updated shortly.

To answer your questions:

When you create a new page, no matter what template you are using, the URL is always relative to /portal (not necessarily true for v1.9, where portal root can be set to anything, including the domain root ‘/’)

So a page with the slug “banana”, would be under “/portal/banana”

To define which template to use (if not using the defaults), you will need to set it in the “custom page code” section of the page editor - just use the name that is at the top of the page template as defined in the “define” tag, for the home page it’s:

{{ define “indexPage” }}

And for a standard page it’s:

{{ define “portalPage” }}

So long as you register a name using this directive, you can add it to the “custom page code” field - i.e. “portalPage”) and Tyk will load that template when rendering the slug target.

You will need to restart the dashboard app though to make sure the templates are cached.

Hope that gets you on your way - documentation soon to follow.

Cheers,
Martin