Get the App
SLTechnology News&Howtos  ›  Servers  › 

Dedecms Custom content Model calls the tag method on the home list page and content

Shulou Source: shulou.com Published: 2022-06-02 03:34:21 11月14日 Update

This article is to share with you about the dedecms custom content model on the home list page and the method of calling tags for content. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How does the dedecms custom content model call tags on the home list page and content?

This article describes the home page, list page and content call method of the custom model (independent model) in dedecms. It is relatively simple to establish the custom model (independent model) in the background and add custom fields. Here are two points to pay attention to:

Articles are all about custom fields added to existing models rather than newly created independent models, so it is impossible to call independent models with arclist tags.

The code is as follows:

{dede:arclistsg typeid='8' row='10' addfields='name,sex,tel' channelid='-101'} [field:title/] name: [field:name/] | gender: [field:sex/] | Tel: [field:tel/] {/ dede:arclistsg}

To get the contents of a custom field, two conditions must be met, one of which is indispensable:

1. Specify the channelid property. This is channelid='-101'.

two。 Specify the field to get, addfields=' field 1, field 2'

(2) the list page calls the custom model (stand-alone model):

The code is as follows:

{dede:list pagesize='10' addfields='name,sex,tel' channelid='-101'} [field:title/] name: [field:name/] | gender: [field:sex/] | Tel: [field:tel/] {/ dede:list}

If the column has content, but the list page does not fall out, it must be because the id of your stand-alone model is not negative.

(3) the content page calls the custom field data of the custom model (independent model):

Write {dede:field.name/} directly where you want to call, where name is changed to the name of the field you want to call.

Thank you for reading! About the dedecms custom content model in the home list page and content call tag method to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Tags: Model content field independent label home page method code name gender article more phone good practical indispensable two name background place Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple Linux vpn Microsoft