Writing links to Web content
Links to content items can be written as URLs.
Linking to web content from other web content
The following examples show how to write links to web content that are to be used with the JSR 286 web content viewer or the Web Content Manager servlet.To create a link from a piece of web content to another piece of web content, use the following URL format:
[URLCmpnt mode="current" context="Selected" type="Content" name="LIBRARY/SITE_AREA_PATH/CONTENT"]
- LIBRARY = the name of the web content library.
- SITE_AREA_PATH = the path to the site area where the content resides.
- CONTENT = the name of the content item.
Linking to web content from an external portlet or web site
To create a link from an external portlet or web site that displays web content, use the following URL format:
http://HOST/wps/wcm/connect/LIBRARY/SITE_AREA_PATH/CONTENT
- HOST = the name of the Web Content Manager host.
- wps/wcm = the Web Content Manager context root.
- LIBRARY = the name of the web content library.
- SITE_AREA_PATH = the path to the site area where the content resides.
- CONTENT = the Name of the content item.
Linking to content displayed in a JSR 286 web content viewer from an external portlet or web site
To create a link from an external portlet or web site to content displayed in a JSR 286 web content viewer, use the following URL format:
http://PORTAL_HOST/wps/mypoc/vp_mapping?urile=wcm%3Apath%3ALIBRARY/ SITE_AREA_PATH/CONTENT&page=unique_name | object_id | &mapping=mapping | ¤t=true | &pagedesign=LIBRARY/PRES_TEMPLATE_NAME
- PORTAL_HOST = the name of the Web Content Manager host.
- wps/mypoc = the Web Content Manager context root, specifying the piece of content lookup service.
- For protected access, use wps/mypoc.
- For unprotected access, use wps/poc.
- vp_mapping = the virtual portal mapping, if appropriate. For example, wps/mypoc/myvp or wps/poc/myvp.
- LIBRARY = the name of the web content library.
- SITE_AREA_PATH = the path to the site area where the content resides.
- CONTENT = the name of the content item.
To address a specific portal page, use one of the following parameters. The parameters cannot be combined.
- page: Specify the unique name or the object ID of the page.
- mapping: Specify the URL mapping for the page.
- current: Indicates that the current page should be used.
To address a specific presentation template to use to render the web content you use the following parameter:
- pagedesign: Specify the name of the library and presentation template to use including the names of all folders
Dynamic page lookup: The page parameter is optional. You can use the link broadcasting feature of the JSR 286 web content viewer to dynamically look up pages by simply omitting the page parameter. For example, if you have a content item called News1, stored in the library Web Content under the site area News, you can create a link to that content item with the following URL:
http://host_name/wps/mypoc?urile=wcm%3Apath%3A/Web+Content/News/News1
Alternatively you can also add a specific portal page using a URL mapping by using the following format:
http://PORTAL_HOST/PORTAL_CONTEXT_ROOT /PORTAL_PAGE_URL_MAPPING/?current=true&urile=wcm%3Apath%3ALIBRARY/SITE_AREA_PATH/CONTENT
- PORTAL_HOST = the name of the portal host
- PORTAL_CONTEXT_ROOT = the portal context root. For anonymous sites use /wps/portal, otherwise use /wps/myportal
- PORTAL_PAGE_URL_MAPPING = the compound name of the portal URL mapping to the portal page that contains the Web Content Manager portlet (URL mappings can be set up using the portal administration portlets).
- LIBRARY = the name of the web content library.
- SITE_AREA_PATH = the path to the site area where the content resides.
- CONTENT = the name of the content item.
The JSR 286 web content viewer on the target page must be configured to receive links from Other portlets and this portlet.
Add cache parameters to a URL
You can add web content Cache parameters and Cache expire parameters to a URL to custom caching strategies to individual items. For example:
http://HOST/wps/wcm/connect/LIBRARY/SITE_AREA_PATH/CONTENT>?cache=site&contentcache=session
Add a last modified parameter to a URL
You can add the last modified date of the current content item to the header of the rendered page. For example:
http://HOST/wps/wcm/connect/LIBRARY/SITE_AREA_PATH/CONTENT>?returnLastModified=true
Parent
Create links and navigation
December 14, 2011
Apr 1, 2011 1:26:17 PM
});