Mohamed ElSheikh
asked on
How can i Filter list view by part of the URL in SharePoint 2010
Hi Experts,
I have main site and 5 different sub sites. I've created a link list in the main site contains URL, Description and Department Code columns.
I named each sub site by department code. so the sub-sute links looks like that:
http://mysite/team/main/12345/SitePages/Home.aspx
12345 is a department code and i want to get this code from the above URL and filter the view by current department code.
please not that i don't have Visual studio or SharePoint designer
kind regards,
Mohamed
I have main site and 5 different sub sites. I've created a link list in the main site contains URL, Description and Department Code columns.
I named each sub site by department code. so the sub-sute links looks like that:
http://mysite/team/main/12345/SitePages/Home.aspx
12345 is a department code and i want to get this code from the above URL and filter the view by current department code.
please not that i don't have Visual studio or SharePoint designer
kind regards,
Mohamed
ASKER
thank you Jamie
sorry to be late. currently, I am away in a business trip
I will test your code when I return back to my office
i will let you know
thanks
sorry to be late. currently, I am away in a business trip
I will test your code when I return back to my office
i will let you know
thanks
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
http://www.sharemuch.com/2013/11/18/sharepoint-silly-questions-filtering-list-view-with-query-string-parameters/
If you could influence your navigation links to include the department code as a parameter you could progress quickly.
Because this is part of a url I can't see an alternative to using script. (VS and Designer not needed) If you're comfortable with script you need to do something like the below. Word of caution this is very thrown together and not tested. It can be improved! (For one thing check that a querystring param doesn't already exist and clash!) Deploy via Page layout or as CEWP on the page;
Open in new window