Dede how to invoke company profile

Source: Internet
Author: User
Dedecms do business site template, the home will often add "about us" or "Company Profile" and the like text, in the column can be made into a "channel cover" or "single page."
But if you want to be able to invoke {dede:field.content/} content dynamically on the homepage, it is not possible to use a single label, because the home page is not a cover sheet. To implement this function, SQL statements are used to read the content fields in the table using SQL statements. As follows:
{dede:sql sql= "Select content from Dede_arctype where id=1"} [field:content/] {/dede:sql} Analysis: Content inside the SELECT content from Dede_arctype is the field that holds the cover content, id=1 refers to the ID of the field name to invoke, [field:content/] This is the underlying field.
If the profile is relatively long, you can limit the number of words: Method one:
{dede:sql sql= "select Content,substring (content,1,100) as content from Dede_arctype where id=7"}
[field:content/] ...
{/dede:sql} Method two:
{dede:sql sql= ' Select content from Dede_arctype where id=1 '}
[Field:content function= ' substr (@me, 0,500) '/]
{/dede:sql}

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.