HOME STORE APPLICATIONS COLDFUSION PHP PORTFOLIO PROFILE CONTACT
Maps: TEXT|HTML|XML|RSS

Freelance Web Developer. ColdFusion, PHP, ASP.net programming worldwide

support@cf-works.com. SMS: +7-911-715-57-84

CategoryPathUp - function to draw parent branches within hierarchical table (Item ID:173)

coldfusion custom tag, function, open source, get parent tree, hierarchical table, parent-child data relationship
Enlarge image: CategoryPathUp - function to draw parent branches within hierarchical tableEnlarge Image
Type:SOFTWARE (downloadable)
Category: Coldfusion Open Source 
Programmer:Nikita Shakhrai   [more items by Nikita Shakhrai]
Seller:CF-Works   [more items from CF-Works]
Price:$3.00
Availability:Downloadable Immediately
Popularity: RateRateRateRateRate
 
  Status:  
Ready

Short description of hierarchical data model AKA parent-child relationship can be found in description of GetAnyBaby custom tag. This function supplements the above referred custom tag. It draws all parent levels up from selected point within table of hierarchical structure. Say to reflect path of parent subcategories on selected product's page, for example:

Category:Web »» Web Development and Design »» Coldfusion


Gold text above is produced by this function.

To accomplish this task, first we need to run recursive GetAnyParent custom tag similar to GetAnyBaby custom tag already mentioned before. GetAnyParent script finds all hierarchical branches above currently selected one and records their IDs into parentids field of the table. Like a string list of IDs, for example as the following:

"768,56,4,1"

Arguments to be passed into GetAnyParents tag are:

branchid- parent branch id
table- parent-child table name
idfield- name of the field-UID (primary key)
namefield- name of the char name value field (source of string value data)
subidfield- name of the field which points to the parent branch
It returns:
idparentlist- list of IDs
nameparentlist- list of names
levelparentlist- nesting levels list

We only will use idparentlist for CategoryPathUp function.

So our hierarchical parent-child table named "webdevelopment":

CATEGORYCATEGORYIDSUBCATOFIDPARENTIDS
Web150 - to be found -
Web Development and Design1615 - to be found -
Coldfusion1716 - to be found -
PHP1816 - to be found -
ASP.net1916 - to be found -

Example of GetAnyParent custom tag call to find all parent IDs for the "Coldfusion" category is:

<CF_GETANYPARENT table="webdevelopment"
   namefield="category"
   idfield="categoryid"
   subidfield="subcatofid"
   branchid="17" >



Which returns list of parent IDs, for example : 15,16

And then we run query to update parentids fields in our table, for instance:

<CFQUERY datasource="#REQUEST.ds#" >
   update webdevelopment set parentids='#idparentlist#' where categoryid=17
</CFQUERY>

On the second and the last step we call CategoryPahUp function to display parent categories with a single quick SQL query.
Example for the table used above may look like this:

<cfscript> CategoryPathUp(table="webdevelopment", categoryid=17, link="dosomething.cfm");</cfscript>

 
BRIEF DESCRIPTION: coldfusion custom tag and function to draw path of parent categories within hierarchical parent-child table data model. open source example. Downloadable


Open/Hide Highlight Group Purchase

Open/Hide Highlight Group Default downloadable file size

 
write review Add your review to this item:
Existing customers please login (click "Your Account" top menu item).
New customers choose Quick Registration including just your name, email and password or Complete Registration


*Ask a Question about CategoryPathUp - function to draw parent branches within hierarchical table:
E-Mail:enter your email address if you would like to be notified when your question is answered
*Anti-spam code:
Please enter anti-spam code to prevent automated scripts' spam submissions. Thank You

  Status:  
Ready


Reviews Rate: Not Rated
Visitors Rate: RateRateRateRateRate   (1 vote)
Rate this item:
 Rate CategoryPathUp - function to draw parent branches within hierarchical table: coldfusion custom tag and function to draw path of parent categories within hierarchical parent-child table data model. open source example. Downloadable