PHPCMS V9 calls the code of the top parent topic of the parent topic

Source: Internet
Author: User

1. Call the parent topic

The first is the parent page and the second-level column page list.html.

 

The code is as follows: Copy code
{$ CATEGORYS [$ top_parentid] [catname]} // top-level parent topic name
{$ CATEGORYS [$ CAT [parentid] [catname]} // the parent topic name has not been tested.
{$ CATEGORYS [$ top_parentid] [XXX]} // related field values of top-level parent columns

In list.html or second-level columns, how does one call related columns and information of the Parent column?

 

The code is as follows: Copy code
{Pc: content action = "category" catid = "$ parentid" num = "25" siteid = "$ siteid" order = "listorder ASC"} // note the parent topic id is $ parentid
<Span >{$ CATEGORYS [$ top_parentid] [catname]} </span>
{Loop $ data $ r}
<A href = "{$ r [url]}" >{$ r [catname]} </a>
{/Loop}
{/Pc}

The content below is the internal page show.html

The code is as follows: Copy code

 
{$ CAT [catname]} // name of the topic on the content page
{$ CATEGORYS [$ top_parentid] [catname]} // the name of the content column, which is the same as list.html.
{$ CATEGORYS [$ CAT [parentid] [catname]} // parent topic name.

The following figure shows how show.html calls the topic list of top parent columns.

The code is as follows: Copy code

 
{Pc: content action = "category" catid = "$ top_parentid" num = "25" siteid = "$ siteid" order = "listorder ASC "}
{Loop $ data $ r} // note that the id of the parent topic is $ top_parentid.
<A href = "{$ r [url]}" >{$ r [catname]} </a>
{/Loop}
/Pc}

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.