Developer forum

Forum » Development » Further overriding URL generation

Further overriding URL generation


Reply
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

Replies

 
Nicolai Høeg Pedersen
Reply
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.
 
Reply

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
 

 
Reply
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
 
Nicolai Høeg Pedersen
Reply
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.
 
Reply
Yes, something like a "flatten consecutive separator characters" would be useful. This would then flatten -- to -, or ___ to _.

Imar

 

You must be logged in to post in the forum