Orkun Posted October 12, 2015 Posted October 12, 2015 Hello everbody I want to make a autoload module that checks if the current page template exist, when not it should make a redirect to its parent page. I thought of something like this: public function init() { if(!$this->page->template->filenameExists()) continue; $this->session->redirect($this->page->parent->url); } My Problem is that when i add a Page via Fredi from the Frontend it redirects to a page that doesnt exist in the frontend. This is because I create Classifications Pages that have a template but not a template file because its not necessary in my case. I know, that i could just write in the templates something like this: $session->redirect($page->parent->url); But they are 8 templates that i have to create and write this and in my view that is unnecessary when i could achieve this only via a module. Thank you for your attention - Nukro
diogo Posted October 12, 2015 Posted October 12, 2015 Easiest way would probably be to have a template file with the redirection and set those templates to use it on the "files" tab of the template settings. 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now