Closed glyphing closed 9 years ago
This PR define a new option distinctUpTo, which is relevant only if distinct = true.
distinctUpTo
distinct = true
Business case: The slug have to be distinct not for the whole collection but only for the given user. Example, we insert:
{title:'Title A', created_user_id:'U1' } {title:'Title B', created_user_id:'U1' } {title:'Title C', created_user_id:'U2' } {title:'Title B', created_user_id:'U2' } {title:'Title C', created_user_id:'U2' }
And the generated slugs are:
title-a title-b title-c title-b title-c-1
The URL will be *https://............/:user/:slug
Use of the new option:
@pages_coll = new Mongo.Collection 'wiki_pages' @pages_coll.friendlySlugs { slugFrom: 'title', distinctUpTo: ['created_user_id'] }
great idea, will publish a new version with this today!
This PR define a new option
distinctUpTo
, which is relevant only ifdistinct = true
.Business case: The slug have to be distinct not for the whole collection but only for the given user. Example, we insert:
And the generated slugs are:
The URL will be *https://............/:user/:slug
Use of the new option: