I really like the idea of the Urlprovider as discussed in this document: http://engage.dynamicweb-cms.com/Admin/Public/Download.aspx?File=Files%2fFiler%2fDocumentation%2fDevelopment%2fGeneral%2f(en-US)+Module+URLs+and+URL+providers.pdf
Very easy to set up; had it up and running in a few minutes.
Two questions though:
1. It appears the data is cached somewhere as I only get a single hit to GetMappings. How can I invalidate the cache (or add items to the list) when my underlying content changes?
2. Is there a way to further hook into the URL generation process? For example, I have an article with a title like "something - somethingelse". DW comverts this to "something---somethingelse" with three subequent dashes. Is there a way to flatten those to a single dash?
Imar
Developer forum
E-mail notifications
Further overriding URL generation
Posted on 18/01/2011 15:47:50
Replies
Nicolai Høeg Pedersen
Posted on 18/01/2011 17:18:20
1: You need to call frontend.UrlProviders.Handler.Reset(parm) - it is internal though... Just made it public so it will be available in upcoming releases. And i cannot find a workaround...
2: In you provider, when creating a new mapping, the third parameter is the name used in the URL - before handing it over you can fix " - " and replace it by just "-" or what ever you like. It is basically just the name used in the URL.
2: In you provider, when creating a new mapping, the third parameter is the name used in the URL - before handing it over you can fix " - " and replace it by just "-" or what ever you like. It is basically just the name used in the URL.
Posted on 18/01/2011 19:00:36
That works well (and was what I ended up doing eventually), but I was wondering if there was a more generic way to do this, to handle this for other situations as well (for example, handling the built-in News URL generation).
Imar
Posted on 19/01/2011 09:13:33
BTW: once I configure the UrlProvider, my existing links will still work, resulting in duplicate content. Is there a way to handle this? The direct path module won't help as it doesn't allow me to supply full URLs....
Imar
Imar
Nicolai Høeg Pedersen
Posted on 20/01/2011 09:05:00
Take it you are talking about the " - " problem. We could add another checkbox somewhere to handle this. Will look into it.
I can see the problem with the existing URLs still working. Will also look into that.
I can see the problem with the existing URLs still working. Will also look into that.
Posted on 20/01/2011 09:18:52
Yes, something like a "flatten consecutive separator characters" would be useful. This would then flatten -- to -, or ___ to _.
Imar
Imar
You must be logged in to post in the forum