We are converting a new site from openCart to OctoberCMS, but I’ve got a problem with URLs and SEO.
SEO gurus tell to preserve all the URLs, but the problem is that openCart is using one URL for the brand page, product page and category page.
How can this be possible with octoberCMS?
The problem is that every page is using other component a I cannot programatically add/remove components for a page.
What I need to do:
One page url :/brand-slug [with brand components]
Second page url: :/product-slug [with product components]
Third page: :/category-slug [with category components]
Is there a pre-router (midleware) or router to find the right model from slug and select the right page?
I can in onStart() method, find the right slug type, but I dont want to include all components in one page, becouse they will fail. I need to add/remove components in onStart() method, or in router.php find the right slug a render and specific page.
Can you please provide me an example of code, because, I cant figure it out how to do it.
This is my code in page (themes/[theme]/pages/everything.htm):
title = "All pages"
url = "/:slug"
layout = "default"
==
<?php
function onInit() {
$this->addComponent(\Offline\Mall\Components\Product::class, 'product',['product'=>$slug]);
}
?>
==