Change the url of the department filter widget
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
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.
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
>
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,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
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
Hi OC,
thanks, that explains it. I will see what solutions I will use.
Regards,
Peter