I created a page called "My Home Page" using the Trongate Pages CMS module.
It is currently available at: localhost/my_app/trongate_pages/display/my-home-page
How can I set it to be the default home page when someone visits my website's BASE_URL (localhost/my_app/)?
I tried to set the default module, controller and method in config.php:
define('DEFAULT_MODULE', 'trongate_pages');
define('DEFAULT_CONTROLLER', 'Trongate_pages');
define('DEFAULT_METHOD', 'display');
Of course, it's giving me an error because I need to somehow let the display() method know that I want to show "my-home-page". How should I go about that?
Or is there something I could do in custom_routing.php to make it work?
Any help is appreciated.
How to create a default home page with Trongate Pages?
2 years ago
2 years ago
#1
2 years ago
#2
Hi Balazs,
Trongate Pages is treated differently with its routes and will allow you to go directly to your pages - like so:This means you can insert literally 'anything' between 'host_name' and your page slug - in your case 'my-home-page'. You can even omit segment(1) and haveand it will still work.
As for setting your default page, you are better off leaving the default welcome page as is in config.php and adding a redirect for the index method:
Trongate Pages is treated differently with its routes and will allow you to go directly to your pages - like so:This means you can insert literally 'anything' between 'host_name' and your page slug - in your case 'my-home-page'. You can even omit segment(1) and haveand it will still work.
As for setting your default page, you are better off leaving the default welcome page as is in config.php and adding a redirect for the index method:
2 years ago
#3
Hello DaFa,
Thank you very much for your quick and helpful response.
I didn't know Trongate Pages handles routes so gracefully. Amazing!
The Trongate Pages module really is a game-changer and sets Trongate apart from other frameworks. Where can I learn more about Trongate Pages?
Thank you very much for your quick and helpful response.
I didn't know Trongate Pages handles routes so gracefully. Amazing!
The Trongate Pages module really is a game-changer and sets Trongate apart from other frameworks. Where can I learn more about Trongate Pages?
2 years ago
#4
The docs are being rewritten as we speak and DC has just put the call out for anyone willing to help.
https://youtu.be/6jtiZdUwibo?si=bpKvjKe4AGvEOk2_
Also, I forgot to mention with the above redirect you could also add your own middleware prior to the redirect, like stat logging etc..to your page.
https://youtu.be/6jtiZdUwibo?si=bpKvjKe4AGvEOk2_
Also, I forgot to mention with the above redirect you could also add your own middleware prior to the redirect, like stat logging etc..to your page.
2 years ago
#5
Great, thank you again DaFa!