Home > Article > Backend Development > Simple tutorial: How to add custom fields to Dreamweaver CMS?
DreamWeaver CMS (DedeCMS) is a powerful open source content management system that can personalize the website through simple operations and adding custom fields. This article will introduce in detail how to add custom fields in Dreamweaver CMS and provide specific code examples to help users easily complete the addition of custom fields.
First, open your DreamWeaver CMS website backend management system and enter your username and password to log in. After entering the background management page, click the "System" option in the left menu bar, and then select "Custom Fields" to set it.
In the "Custom Fields" page, you can see the list of existing fields. Click the "New Field" button in the upper right corner and fill in the field name, identifier, field type and other information. Here is an example:
After filling in the field information, click the "Save Field" button at the bottom of the page to save. Then, in the column where the field needs to be added, click "Field Management", select "Add Field", check the field just created, and click the "Apply Field" button to successfully add the custom field.
To display the content of the custom field in the article page, you need to add the corresponding code to the template file. The following is a simple PHP code example, assuming that the identifier of the article author is author:
<?php global $arclist; $arc = $arclist; $author = $arc->Fields['author']; echo "作者:" . $author; ?>
Finally, in the template file of the article details page Insert the above PHP code into , save the template file and refresh the web page. You can see that the custom fields of the article author have been successfully displayed on the page.
Through the above simple steps, you can easily add custom fields to Dreamweaver CMS and display them on the website page. I hope this article was helpful, if you have any questions or need further help, please feel free to leave a message below and we will get back to you as soon as possible.
The above is the detailed content of Simple tutorial: How to add custom fields to Dreamweaver CMS?. For more information, please follow other related articles on the PHP Chinese website!