THINKCMF Sub-column to get the parent column all sub-columns list

Source: Internet
Author: User

Website construction often need to output a column of sub-columns, corresponding to the Sub-column list page also need to output the parent column of the Sub-column list, THINKCMF can output all sub-columns, but not in the Sub-column list page also applicable,

Therefore, you need to complete the requirements by querying the database tables:

<? php $RS = M (' terms ')->where (Array (' term_id ' = + $term _id))->find ();     $parent = M (' terms ')->where (Array (' term_id ' = + $RS [' parent '])->find (); ?>

This method finds its parent by querying the terms table, and then outputs the sub-columns,

1 <PHP>2 $term _id= $term _id;3 $terms =sp_get_child_terms ($RS [' parent ']);//Get sub-categorical information4 </PHP>5 <foreachname= "Terms"Item= "Vo">6 {$vo. Name}7 </foreach>

Similarly, you need to query the parent column name:

1 {$parent. Name}

Abstract, the same keyword

THINKCMF Sub-column to get the parent column all sub-columns list

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.