OriginalTechnology
# Empire CMS

Imperial CMS: How to batch import Excel data table data?

1,026 words3 minute361 views0 likes

Summary

This article details the steps for Empire CMS to batch import Excel data: upload plug-in files, modify the background template to add import and export buttons, pay attention to the field order and time format (for example, 2022-10-20 12:00:05 needs to be set to text), avoid audit settings, etc. The core conclusion is that batch import can be successful if the field order and format are strictly matched, otherwise an error will be reported.

Sometimes you need to import data into Empire CMS in batches, and you need to use the Excel batch plug-in;

The steps are as follows:

1. Upload the plug-in to /e/extend/2. Upload the files exceladdnews.php, excelecmsinfo.php, excelputout.php, excelputout_detail.php to /e/admin/; 3. Modify: \e\data\html\list\listinfo.php; find the code

, insert code before:

<!--20221020-->
<div style="padding: 5px 5px;background: #f4f4f4;">
<!-- 批量导入csv -->
    <input type=button name=button value="批量导入EXCEL" onClick="self.location.href='exceladdnews.php?ecmsnfrom=1<?=$addecmscheck?>&bclassid=<?=$bclassid?>&classid=<?=$classid?><?=$ecms_hashur['ehref']?>'">
<!--批量导出csv -->
    <input type=button name=button value="批量导出EXCEL" onClick="self.location.href='excelputout.php?ecmsnfrom=1<?=$addecmscheck?>&bclassid=<?=$bclassid?>&classid=<?=$classid?><?=$ecms_hashur['ehref']?>'">
</div>
<!--20221020-->

4. After inserting the above code, return to the background and the import and export buttons will be displayed above the information box. Note that you need to modify the background paths of exceladdnews.php and excelputout.php, otherwise the click field reference will be invalid.

5. Download the instance template and fill in data in batches in the corresponding template fields;

6. Note that when processing data in batches, the newstime field must use the format of 2022-10-20 12:00:05. If the data in this format is filled in, it cannot be displayed, and the cell format needs to be set to text; other fields must correspond one to one, and the order must also correspond. There cannot be more or less fields, otherwise an error will be reported, causing the upload to fail.

7. Batch upload; note that for batch upload, if you do not want to upload directly for review, you can cancel the option of whether to review.

Download source code,https://img.yxskj.cn/xcxhtwg/202405221626206.zip

Loading comments…
Related articles

Related articles