Sarotobi
Sarotobi

Reputation: 831

Framework7 how to route as a sub page

I am new with Framework7 and want to use the single page application template as a subpage and going to load it from another webpage, but while attempting this the main router does not load or maybe I am not doing it correctly?

So the default route is like below.

routes = [
  {
    path: "/",
    url: "./index.php"
  },
[

Now I am attempting to load it like this capturing the id from the external page

routes = [
      {
        path: "/:id/",
        url: "./index.php"
      },
    [

My external page (not a framework7 page) link is like this.

<a href="/product/1/">View Product</a>

I also tried this

 <a href="http:/localhost/products/product/1/">View Product</a>

But I am getting the default page 404 error not the 404 on Framework7 meaning the route is not loading, any suggestion would be great!

Upvotes: 0

Views: 442

Answers (1)

Flash
Flash

Reputation: 1125

have you tried making the route to be :

   routes = [
      {
         path: '/product/:id',
         url: 'somepage.html'
      },
     ]

the one with a path just path: /:id will pass to index an ID and not a product.

I think loading a separate F7 page will do you more good than trying to override the index page

Upvotes: 1

Related Questions