Difference between revisions of "CSData 1 0-getCSPageURL"
From ADF Docs
Dbeckstrom (talk | contribs) (→Description) |
|||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| + | __NOTOC__ | ||
| + | Attention: Do not change any text in the description, signature, and paramter sections. | ||
| + | |||
| + | Return to [[CSData_1_0]] | ||
| + | |||
== Description == | == Description == | ||
| + | Given a Commonspot Page ID build a URL to that page. | ||
== Signature == | == Signature == | ||
public string <strong>getCSPageURL</strong> ( numeric pageID ) | public string <strong>getCSPageURL</strong> ( numeric pageID ) | ||
| − | == Parameters == | + | == Parameters == |
| + | |||
| + | <table id="lib-params"> | ||
| + | <tr class="header"> | ||
| + | <td>Required</td> | ||
| + | <td>Name</td> | ||
| + | <td>Type</td> | ||
| + | <td>Description</td> | ||
| + | </tr> | ||
| + | |||
| + | |||
| + | <tr> | ||
| + | |||
| + | <td class="required">required</td> | ||
| + | |||
| + | <td>pageID</td> | ||
| + | <td>numeric</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | </table> | ||
| + | === Usage: === | ||
| + | Example 1: Use getCSPageURL to return the URL for a page where the PageID was stored in an element: | ||
| + | <source lang="cfm"> | ||
| + | <cfscript> | ||
| + | relativePageURL = application.ADF.CSData.getCSPageURL(items[i].values.myPageID); | ||
| + | </cfscript> | ||
| + | </source> | ||
| − | + | Example 2: Use getCSPageURL in a datasheet column render handler to convert a pageID to a URL: | |
| + | <source lang="cfm"> | ||
| + | <cfscript> | ||
| + | if ( LEN(Request.Datasheet.currentColumnValue) ) | ||
| + | pageURL = application.ADF.csData.getCSPageURL(Request.Datasheet.currentColumnValue); | ||
| + | else | ||
| + | pageURL = ""; | ||
| + | </cfscript> | ||
| + | <cfsavecontent variable="request.datasheet.currentFormattedValue"> | ||
| + | <cfoutput><td> | ||
| + | <cfif LEN(pageURL)> | ||
| + | <a href="#pageURL#">#pageURL#</a> | ||
| + | </cfif> | ||
| + | </td></cfoutput> | ||
| + | </cfsavecontent> | ||
| + | <cfset request.datasheet.currentSortValue = pageURL> | ||
| + | </source> | ||
Latest revision as of 19:46, 26 March 2012
Attention: Do not change any text in the description, signature, and paramter sections.
Return to CSData_1_0
Description
Given a Commonspot Page ID build a URL to that page.
Signature
public string getCSPageURL ( numeric pageID )
Parameters
| Required | Name | Type | Description |
| required | pageID | numeric |
Usage:
Example 1: Use getCSPageURL to return the URL for a page where the PageID was stored in an element:
<cfscript>
relativePageURL = application.ADF.CSData.getCSPageURL(items[i].values.myPageID);
</cfscript>Example 2: Use getCSPageURL in a datasheet column render handler to convert a pageID to a URL:
<cfscript>
if ( LEN(Request.Datasheet.currentColumnValue) )
pageURL = application.ADF.csData.getCSPageURL(Request.Datasheet.currentColumnValue);
else
pageURL = "";
</cfscript>
<cfsavecontent variable="request.datasheet.currentFormattedValue">
<cfoutput><td>
<cfif LEN(pageURL)>
<a href="#pageURL#">#pageURL#</a>
</cfif>
</td></cfoutput>
</cfsavecontent>
<cfset request.datasheet.currentSortValue = pageURL>