Change the url of the department filter widget

Posted by Community Admin on 05-Aug-2018 22:46

Change the url of the department filter widget

All Replies

Posted by Community Admin on 09-Feb-2012 00:00

Hi all,

I'd like to change the url, when using the Departments widget.
Now I can filter on departments and the URL becomes like this:

mysite/.../

I want to have it like this:
http://mysite/products/books/

How can I achieve this?

Regards,
Daniel



Posted by Community Admin on 10-Feb-2012 00:00

Hey Daniel,

For products this is easy to do (Administration>>Catalog>>Providers>>OpenAccessProvider>>Parameters and then add a 'urlFormat' key and a value).

For departments (which is a hierarchical taxonomy) you'd think adding the same parameter (under Administration>>Taxonomy>>Providers>>OpenAccessDataProvider>>... ) would do the same trick, but unfortunately not. Under Data>>URL Evaluators>>Taxonomy there's also a parameter section, but that's unfortunately undocumented - I did a blond attempt to verify, but no success.

So it seems only a Custom Provider (as described in Slavo Ingilizov's post) might do the trick. However, this approach seems to clash with the standard pager control which results into PITS Issue #9577. (Update from Lubomir Velkov on Feb 2 2012: probl not make it for v5.0 release)

I could be wrong because I've not created and tested the custom provider myself but for now it seems a no go all around.

---
TIP FOR DUMMIES LIKE ME:
If you're going to do some coding, be aware of OpenAccessProvider vs OpenAccessDataProvider - has cost me a few hours in the past already :)
---

Jochem.

Posted by Community Admin on 16-Nov-2012 00:00

Hi there. I manged to do this by using IIS UrlRewrite 2.0. Added the following rule:

<rule name="DepartmetnsRewrite" stopProcessing="true">
    <match url="^products/([^$]+)" />
    <action type="Rewrite" url="products/-in-Department/Departments/R:1" />
</rule>
 And off course you have to do an outbound rule or change the navigation widgets to make the right urls for the client to click.

See it in action here: www.hobbyeurope.com 

OC

Posted by Community Admin on 20-Nov-2012 00:00

Hello,

 The URL rewrite method is the preferred method to accomplish this task provided by Ole Christian Synnes and has been marked as the answer.

Kind regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 25-Mar-2013 00:00

Hi OC,

your rewrite rule is working fine, thanks! I was wondering how you changed the URL's behind the departments widget. It's still pointing to the "-in-department/departments" url (off course).

Regards,
Peter

Posted by Community Admin on 25-Mar-2013 00:00

Peter,
I'm not using the Department widget at all. I have made my own from scratch.
But I guess it would be just as easy to make an url-rewrite outbound rule that does it the other way around, as the inbound rule I pointed out above.
OC

Posted by Community Admin on 25-Mar-2013 00:00

Hi OC,

thanks, that explains it. I will see what solutions I will use.

Regards,
Peter

This thread is closed