UrlDirName Element (View)
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Specifies the site-relative URL for the directory that contains a document.
The following example uses the UrlDirName element to construct the absolute URL for a thumbnail image in a picture library.
<DisplayPattern> <HttpHost /> <UrlDirName> <HTML>/</HTML> <LookupColumn URLEncodeAsURL="TRUE" Name="FileRef" /> </UrlDirName> <HTML>/_t/</HTML> <UrlBaseName> <Field Name="EncodedAbsUrl" /> </UrlBaseName> <HTML>_</HTML> <GetFileExtension> <Field Name="EncodedAbsUrl" /> </GetFileExtension> <HTML>.jpg</HTML> </DisplayPattern>
If the image file has a .jpg extension and is contained in a picture library on a subsite, the example creates a URL in the following form: