Linking to a relative Viewport from a Presenter in a Subpage and retaining Back functionality

Good morning

New system we’ve built requires that we link to a record in a Viewport from a list in a Subpage. Both Subpage and Viewport are reused across several Top Tabs. We need the user to remain within their current Top Tab when clicking through to view the record in the Viewport.

Create doesn’t (can’t?) allow you to set up a link to a relative page from within a Sub Tab, so we’ve knocked up a presenter to accomplish this by chopping the relevant parts out of the URL and redirecting the user to the correct Viewport and Record within the current Top Tab.

This works (albeit it not quite a snappily as we’d like), however it breaks the Top Tab back back button functionality - the button doesn’t appear when we land in the Viewport.

And so finally to my question :slight_smile:

Is there a way of redirecting to a Viewport from a Presenter within a Subpage that doesn’t break the Top Tab’s back button functionality?

Morning Russ,

Can’t see how you are building the links in your presenter, but if you ensure you are specifying a relative path, you should have no issues:

<a class="record_link" href="/i/INTERFACENAME/p/PAGEPATH?auth=&id=" data-ts-interaction="link">
	<span class="value-as-text">View</span>
</a>

Issues might arise if you are building an absolute link as create won’t know to do anything as it could come from anywhere.

Let me know if this helps, I am just guessing :smiley:

Dan.

Thanks Dan,

To speed up page load we built our presenter to generate the URL on click and redirect.

Gonna try this out instead though and see how it goes :slight_smile:

Russ

No problem,

You can still use a method to generate the link on click if you wanted to, just create the link in the format above with the relative path and hopefully the back button shows when you click through.

Dan.

Cheers Dan,

Went your way and page load is completely fine even with 25+ instances. I was definitely overcomplicating things before by trying to be resource efficient! Reckon I’m still scarred from years of scraping by on Class 2 :stuck_out_tongue:

Russ

1 Like