Difference between revisions of "Taxonomy 1 0-getCSTaxObj"

From ADF Docs
Jump to: navigation, search
(CE Data calls return Taxonomy Term ID)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://edojalys.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://edojalys.co.cc CLICK HERE]=
 +
----
 +
</div>
 
__NOTOC__
 
__NOTOC__
 
Attention: Do not change any text in the description, signature, and paramter sections.
 
Attention: Do not change any text in the description, signature, and paramter sections.
Line 8: Line 16:
  
 
== Signature ==  
 
== Signature ==  
public any <strong>getCSTaxObj</strong> ( string taxName )
+
public any &lt;strong&gt;getCSTaxObj&lt;/strong&gt; ( string taxName )
  
 
== Parameters ==  
 
== Parameters ==  
  
<table id="lib-params">
+
&lt;table id=&quot;lib-params&quot;&gt;
<tr class="header">
+
&lt;tr class=&quot;header&quot;&gt;
<td>Required</td>
+
&lt;td&gt;Required&lt;/td&gt;
<td>Name</td>
+
&lt;td&gt;Name&lt;/td&gt;
<td>Type</td>
+
&lt;td&gt;Type&lt;/td&gt;
<td>Description</td>
+
&lt;td&gt;Description&lt;/td&gt;
</tr>
+
&lt;/tr&gt;
 
 
 
 
<tr>
+
&lt;tr&gt;
 
 
<td class="required">required</td>
+
&lt;td class=&quot;required&quot;&gt;required&lt;/td&gt;
 
 
<td>taxName</td>
+
&lt;td&gt;taxName&lt;/td&gt;
<td>string</td>
+
&lt;td&gt;string&lt;/td&gt;
<td></td>
+
&lt;td&gt;&lt;/td&gt;
</tr>
+
&lt;/tr&gt;
 
 
</table>
+
&lt;/table&gt;
  
 
== Examples ==
 
== Examples ==
Line 38: Line 46:
 
=== CE Data calls return Taxonomy Term ID ===
 
=== CE Data calls return Taxonomy Term ID ===
 
If you have Taxonomy fields inside your Custom Element and you make calls to get data for that custom Element using CEData, the Taxonomy fields will return term ID's.  You can convert those term ID's using code like this:
 
If you have Taxonomy fields inside your Custom Element and you make calls to get data for that custom Element using CEData, the Taxonomy fields will return term ID's.  You can convert those term ID's using code like this:
<source lang="cfm">
+
&lt;source lang=&quot;cfm&quot;&gt;
  <cfscript>
+
  &lt;cfscript&gt;
 
     // custom element data
 
     // custom element data
     data = application.ADF.ceData.getCEData("My Element");
+
     data = application.ADF.ceData.getCEData(&quot;My Element&quot;);
 
     // returns taxonomy object
 
     // returns taxonomy object
     taxObj = application.ADF.taxonomy.getCSTaxObj("My Taxonomy");
+
     taxObj = application.ADF.taxonomy.getCSTaxObj(&quot;My Taxonomy&quot;);
  </cfscript>
+
  &lt;/cfscript&gt;
  
  <cfloop from="1" to="#arrayLen(data)#" index="itm">
+
  &lt;cfloop from=&quot;1&quot; to=&quot;#arrayLen(data)#&quot; index=&quot;itm&quot;&gt;
     <!---// renders the term name instead of the term id --->
+
     &lt;!---// renders the term name instead of the term id ---&gt;
     <cfoutput>#taxObj.getTermName(data[itm].values.myTaxField)#</cfoutput>
+
     &lt;cfoutput&gt;#taxObj.getTermName(data[itm].values.myTaxField)#&lt;/cfoutput&gt;
  </cfloop>
+
  &lt;/cfloop&gt;
</source>
+
&lt;/source&gt;

Revision as of 23:02, 23 November 2010



Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page


CLICK HERE


Attention: Do not change any text in the description, signature, and paramter sections.

Return to Taxonomy_1_0

Description

Returns the taxonomy object for a given taxonomy name

Signature

public any <strong>getCSTaxObj</strong> ( string taxName )

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>taxName</td> <td>string</td> <td></td> </tr>

</table>

Examples

Using the getCSTaxObj function is simple and straight forward. Making a call to this method will return a component which contains all of the Taxonomy API calls available in the CommonSpot Taxonomy.

CE Data calls return Taxonomy Term ID

If you have Taxonomy fields inside your Custom Element and you make calls to get data for that custom Element using CEData, the Taxonomy fields will return term ID's. You can convert those term ID's using code like this: <source lang="cfm">

<cfscript>
    // custom element data
    data = application.ADF.ceData.getCEData("My Element");
    // returns taxonomy object
    taxObj = application.ADF.taxonomy.getCSTaxObj("My Taxonomy");
</cfscript>
<cfloop from="1" to="#arrayLen(data)#" index="itm">
   <!---// renders the term name instead of the term id --->
   <cfoutput>#taxObj.getTermName(data[itm].values.myTaxField)#</cfoutput>
</cfloop>

</source>