Are you a faithful user of Bamboo List Rollup Web Part? Have you had the frustrating realization of creating the resulting List Rollup Data View internally, just to find out that your external users link to items from the List Rollup Data View still used the internal URL?
Well fear no more! In the latest release of List Rollup Web Part (File Version 3.3.2.0) we now support a trusty HTML trick of Relative URLs, YEAH!!!!!! So let me first introduce you to the Relative URL in general then I'll explain how it folds into List Rollup Web Part.
Let us say I have the following URL - http://bamboosolutions.com/Products/ListRollup.jpg
In use case 1, I have 2 URLs accessing the same data - http://bamboosolutions.com and http://store.bamboosolutions.com the image ListRollup.jpg exists in Products directory for both URLs just different host URLs (FYI, a host URL is the first part of a URL, in this case http://bamboosolutions.com and http://store.bamboosolutions.com).
Relative URL has two methods to achieve the ability to adapt to any host URL provided by using either "/" or "~/", as in our examples, the format could be
- /products/listrollup.jpg
- ~/products/listrollup.jpg
In the second use case, relative URL provides a shorthand method to write URLs. Here we will explain 2 types of shorthand methods: files that exist in the current directory, and files that exist in a different directory. The first type, files that exist in the same directory, means, in our example URL, http://bamboosolutions.com/Products/ListRollup.jpg we are currently in the directory of http://bamboosolutions.com/Products. I want to get to a file called CalendarPlus.jpg that exists in this same directory. Instead of writing the full URL http://bamboosolutions.com/Products/CalendarPlus.jpg, I can use ./CalendarPlus.jpg since I am already sitting in the /Products/ directory.
The other shorthand method provided by relative URL is ability to access files from other directories without entering the entire URL. Again, we are currently at the following URL - http://bamboosolutions.com/products/ListRollup.jpg and you need to access a file at the following directory: http://bamboosolutions.com/Community/BambooNation.jpg. Instead of writing the full URL, you can use the combination ../ to instruct the browser to go up to the parent directory first then append. In our case the example would be ../community/BambooNation.jpg. Since the parent directory of Products is the host URL, a better example, would probably be the following -
Current URL: http://bamboosolutions.com/AllProducts/ListRollup/LearnMore.aspx and I need to get an image file to display on this page from http://bamboosolutions.com/AllProducts/CalendarPlus/ListRollupConnection.jpg I would enter the URL ../CalendarPlus/ListRollupConnection.jpg since the parent directory is /AllProducts/
You can use the parent directory shortcut as many times as needed. So for example, if my current URL is http://bamboosolutions.com/AllProducts/Listrollup/LearnMore.aspx and I need to go to the following URL to get a file - http://bamboosolutions.com/Community/BambooNation/Blogs.jpg, I would enter ../../Community/BambooNation/Blogs.jpg
OK so now that we got the basics of Relative URL down, let us talk about how it impacts our List Rollup Web Part.
Use Case 1 - Alternate Access Mappings
In SharePoint, it is common practice to have multiple URLs hitting the same content: the intranet URL (most likely the server name http://ProductionServer) and an extranet URL (i.e. http://www.production.com). When you build your List Rollup Data View from the List Rollup Web Part, in the Site URL field, make sure that you use one of the host URL substitute methods (i.e. / or ~/). This will build your final List Rollup Data View using the relative URL so no matter if your user is loggin in using the intranet or extranet URL, the item URLs int he resulting List Rollup Data View will be built based on the URL of the browser.
Use Case 2 - Shorter URL for multiple lists
You can also use the shorthand method of building URLs through List Rollup Web Part but take note that when using the Shorthand URL method, it is based on where the resulting List Rollup Data View resides. Here is an example. I am currently on the following Web Part Page http://ProductionServer/Sites/English/ListRollup.aspx where List Rollup Web Part resides. I have a list sitting on the following site - http://ProductionServer/Sites/French that I want to rollup. In the List Rollup Web Part for Site URL I enter ../French and select the list I want to rollup. After building the List Rollup Data View, I see items from my French site with no problem. I export the Data View and place it on the top level site http://ProductionServer/, now I see nothing. This is because the URL defined int he List Rollup Data View is defined to go up a level and since the data view resides on the top level site already it is going to fail. Now if I have placed the List Rollup Data View on http://ProductionServer/Sites/German/ it will work since it is on the same level (also known as Sibling site) as the English site.
I hope this helps! For more information about List Rollup Web Part and building the List Rollup Data Views, see here - http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/07/02/list-rollup-intro-links-to-how-to-guides.aspx
Posted
Dec 02 2008, 10:28 AM
by
Jeff Kozloff
Jeff originally joined Bamboo Solutions in June of 1999 as a part-time Test Engineer (basically a gopher). He continued with Bamboo as a part time tester while obtaining my Bachelors of Science in Computer Science degree at Longwood University. Upon graduation in 2004, Jeff accepted a full time position at Bamboo as a Helpdesk Specialist and became Manager of the Helpdesk team in 2006. In October of 2007 until present, Jeff took a role as Project Manager in the Solution group bringing his in depth technical knoweldge of SP to Bamboo's customers.