Generates an absolute URL to a registered site.

Class Name

atg.droplet.multisite.SiteLinkDroplet

Component

/atg/dynamo/droplet/multisite/SiteLinkDroplet

Input Parameters

siteId

Identifies the site used to generate the URL. If set to null, the generated URL uses the URL of the current site.

path

Path string to include in the generated URL.

queryParams

Query parameters to include in the generated URL.

protocol

The protocol to use—http or https—in the generated link. If omitted, the protocol is set from the SiteURLManager property defaultProtocol.

inInclude

A Boolean flag, specifies whether relative paths should use the URL of the included page.

Output Parameters

output

Rendered if the URL is generated.

url

Set to the generated URL.

error

Rendered if an error occurs.

errorMessage

Contains the error message if an error occurs.

Usage Notes

Given a site ID and optional path, SiteLinkDroplet generates an absolute URL to another site. SiteLinkDroplet constructs URLs for a requested site according to the following rules:

URL construction varies depending on whether production site URLs follow a domain-based or path-based strategy. The following examples show how SiteLinkDroplet generates URLs according to these diferent strategies.

Production-site URLs use path-based strategy

Target site’s production site URL:
/foo

Current URL:
http://domain.com/bar/dir/index.jsp

Input path

New URL

""

http://domain.com/foo/dir/index.jsp

/

http://domain.com/foo

/path/help.jsp

http://domain.com/foo/path/help.jsp

path/help.jsp

http://domain.com/foo/dir/path/help.jsp

Production-site URLs use domain-based strategy

Target site’s production site URL:
foo.com

Current URL:
http://domain.com/dir/index.jsp

Input path

New URL

""

http://foo.com/dir/index.jsp

/

http://foo.com

/path/help.jsp

http://foo.com/path/help.jsp

path/help.jsp

http://foo.com/dir/path/help.jsp

Preview query parameters

If a site link is generated on a preview server—that is, a server that is assembled with the –preview switch—SiteLinkDroplet automatically appends two sticky site query parameters to the generated link: pushSite and stickySite. For more information about sticky site parameters, see the Multisite Request Processing chapter in the Platform Programming Guide.

Note: If a site ID contains unconventional characters—for example, @ (at) and ~ (tilde)—you can enter them directly for the input parameter siteId. However, settings for input parameters path and queryParams must use URL encoding for non-alphanumeric characters—for example, %40 and %7E for at (@) and tilde (~) characters, respectively.

Example

See SiteIdForItem.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices