I have a page type 'ProductPage', it has tabs that are navigated to like so:
/ProductPageUrlSegment/?tab=video
/ProductPageUrlSegment/?tab=audio
/ProductPageUrlSegment/?tab=photos
I'd like for redirects to be created when each new product page is created so that if you navigated /ProductPageUrlSegment/video it goes to /ProductPageUrlSegment/?tab=video
and the same for all tabs. I'm not clear if I should be using Routing https://docs.silverstripe.org/en/3.3/developer_guides/controllers/routing/ or redirection https://docs.silverstripe.org/en/3.3/developer_guides/controllers/redirection/
I have a link function for another project which goes to the parent page
public function Link() {
return $this->Parent()->Link() . '#' . $this->URLSegment;
}
Mine would be something like:
public function LinkVideo() {
return $this->Link()->'/?=video' . '#' . $this->URLSegment->'/video';
}
I don't have the knowledge to work this out so any guidance appreciated.
This will achieve the above, by handling the URL as an action and then redirecting to the same page, but with the get variable set...