Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routes are overriding existing pages. Need help! #21

Open
bzerangue opened this issue Nov 9, 2014 · 9 comments
Open

Routes are overriding existing pages. Need help! #21

bzerangue opened this issue Nov 9, 2014 · 9 comments

Comments

@bzerangue
Copy link
Member

I created a Page called page and set up the following routes...

From /:pt1

To /page/:pt1

and

From /:pt1/:pt2

To /page/:pt1/:pt2

I also, setup a page called menu and the page is ignored since I have the above route setup...

So then I add in the following route...

From /menu/

To /menu/

And nothing happens, it still uses the Page called page instead of menu

How I am able to use another page?

@nitriques
Copy link
Member

From what I understand, not you can't.

From /:pt1
To /page/:pt1

Will always win... Can you try to reverse the order in which they are declared ?

@bzerangue
Copy link
Member Author

I did. Doesn't do anything 


Sent from Mailbox

On Sat, Nov 8, 2014 at 7:50 PM, Nicolas Brassard [email protected]
wrote:

From what I understand, not you can't.

From /:pt1
To /page/:pt1

Will always win... Can you try to reverse the order in which they are declared ?

Reply to this email directly or view it on GitHub:
#21 (comment)

@nitriques
Copy link
Member

Well, having a route match anything will always win... It order for it to work, you would need to implement some kind of check to try an match static route (/menu) before any wildcard ones...

@bzerangue
Copy link
Member Author

I did that and it doesn't recognize the static route 


Sent from Mailbox

On Sat, Nov 8, 2014 at 7:56 PM, Nicolas Brassard [email protected]
wrote:

Well, having a route match anything will always win... It order for it to work, you would need to implement some kind of check to try an match static route (/menu) before any wildcard ones...

Reply to this email directly or view it on GitHub:
#21 (comment)

@bzerangue
Copy link
Member Author

What should my static route look like?


Sent from Mailbox

On Sat, Nov 8, 2014 at 7:56 PM, Nicolas Brassard [email protected]
wrote:

Well, having a route match anything will always win... It order for it to work, you would need to implement some kind of check to try an match static route (/menu) before any wildcard ones...

Reply to this email directly or view it on GitHub:
#21 (comment)

@nitriques
Copy link
Member

What should my static route look like?

I meant changing the php code of this extension in order to prioritize /menu (static route) over /:pt1 (dynamic/wildcard route).

Or maybe a a simplier thing to do would be to add a priority property on each route, and try to match them accordingly.

But right now, it do not think that your setup is possible with this codebase. Sorry! (@BREND0 am I right?) If you ever do it, please consider sending a PR!

@nitriques
Copy link
Member

I meant @brendo 😄

@jonmifsud
Copy link

@nitriques just posted a separate comment on the commit - I've just noticed this issue too updating a legacy site. I think there should be some flag to by-pass this.

@nitriques
Copy link
Member

@jonmifsud I would review any PR you can send. Sadly, I do not use that extension a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants