XF 2.0 Passing argument in URL to a custom page

Carlo

Member
I have created a new page called errorpage accessible via www.example.com/pages/errorpage/. I want to be able to pass an argument to the URL like www.example.com/pages/errorpage?error=access_denied. Then process that argument within the HTML template, i.e. using javascript or php to display a custom content. Is that possible? I see there is possibility of using PHP callback but I'm not really sure how to use it.

My objective is to be able to customize connected_account.php such that if an error occurs due to external account login (e.g. user cancelled FB login), it redirects back to my custom errorpage passing the error message as an argument. The error message then gets displayed in my custom page (with all the headers and footers). Right now the current implementation is that is just displays a plain text with the error message and not even a link back to the forum. See example below from xenforo.com:

Screen Shot 2018-02-17 at 3.08.34 PM.webp
 
Top Bottom