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

Unique page name #21

Open
Webdesignwill opened this issue Dec 21, 2014 · 2 comments
Open

Unique page name #21

Webdesignwill opened this issue Dec 21, 2014 · 2 comments

Comments

@Webdesignwill
Copy link
Owner

Can have multiple pages the same name. Although this isn't a problem, it could still cause problems.

Each page will have it's path and route dynamically created before save in Mongo. Although it would be bad to have the same name at the same level for example :

www.siteify.io/about
www.siteify.io/about

It's not a problem to have :

www.siteify.io/customer
www.siteify.io/people/customer

As the routes would be different. . . .

The solution for now would be to add unique : true to the page model in Node and also to save wasting a request, check if the page title is unique in the pages collection.

@poodlehat
Copy link
Contributor

Fix on fork commit here: poodlehat@1ff4cab

Currently uses a bit of code duplication in controllers\pages.js line 11 to build the path string for the check - coped from the PagesSchema declaration. Ideally this would use a function that the schema would also use, but not sure of the scope of this. Have todo'd it.

@poodlehat
Copy link
Contributor

Although watch out for my .idea project directory... commited it by mistake. Removed it in the next commit. My bad...

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

No branches or pull requests

2 participants