I want to set custom url for my pages. Please see below:
I have main ‘products’ page inside products i have multiple products(children pages).
- prod1 (/products/prod1)
- prod2 (/products/prod2)
i want to set custom url as per below for above
- prod1 (/fd/beginners-guide)
- prod2 (/mf/sip)
Please suggest solution for it
Just for those two pages? Do they have different blueprints? Are there more subpages in the products folder than those two?
There are more pages in products.
But my aim is i want to set custom url to any page . It will be main page or subpage or children->children->children… . any page
The you probably need to add a field to the pages with this custom url, set up a page model that rewrites the url method to this custom url.
Then you also need a route with an array of patterns from this field, which then finds the correct page in the products folder and returns it.
I am trying this. Can i able to set custom url to any page in app or for only specific template? you I want that custom url option to every page
You could set up a custom url page method (e.g customUrl()) that you would then use instead of the
url() method. You can only overwrite native methods in models.