码迷,mamicode.com
首页 > 其他好文 > 详细

[MODx] Build a CMP (Custom manager page) using MIGX in MODX 2.3 -- 1

时间:2015-03-05 20:55:44      阅读:611      评论:0      收藏:0      [点我收藏+]

标签:

BIG FUCK for MODx


 

MODx document is not that good  ...  at least in my opint of view. I spend hours to search martirals to find out how to build a CMP by using MIGX in MODX 2.3. The officail doument are written for 2.2, but since 2.3, it changed a lot.

 

OK, that‘s how to do this shit...

You can check those two vedios:

https://www.youtube.com/watch?v=Dv83iC9iELI  (How to setup CMP in MODx 2.2)

https://www.youtube.com/watch?v=LPJQrsiDdQ4 (Changes in 2.3)

 

1. INSTALL MIGX (do it yourself)

2. Create package: Package Name: serialnumber; talbe-prefix: serialnumber

技术分享

 

3. Go XML-Schema tab:

<?xml version="1.0" encoding="UTF-8"?>
<model package="serialnumber" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" phpdoc-package="serialnumber" phpdoc-subpackage="model" version="1.1">
  <object class="Serials" table="serial" extends="xPDOSimpleObject">
    <field key="serial_no" dbtype="varchar" precision="32" phptype="string" null="false" default="" index="index" />
    <field key="material_no" dbtype="varchar" precision="32" phptype="string" null="false" default="" />
    <field key="description" dbtype="text" phptype="string" null="true" />
    <field key="download_count" dbtype="int" precision="10" phptype="integer" null="false" default="1" />
    <index alias="serial_no" name="serial_no" primary="false" unique="false" type="BTREE">
        <column key="serial_no" length="" collation="A" null="false" />
    </index>
    <composite alias="odDownloads" class="odDownloads" local="serial_no" foreign="serial_no" cardinality="many" owner="local" />
    <composite alias="odLog" class="odLog" local="serial_no" foreign="serial_no" cardinality="many" owner="local" />
    <composite alias="odFiles" class="odFiles" local="serial_no" foreign="serial_no" cardinality="many" owner="local" />
  </object>
</model>

 

4. Go "Parse Schema" tab and click "parse Schema" button.

5. Go "Create tables" tab and click "create tables" button.

 

6. You can now check two things, make sure everything wokrs fine:

  • Go to phpmyadmin, find your table ‘serialnumberserial‘
  • Go to "Files" --> "core" --> "Compoments" --> "serialnumber" --> "model" 

You will see like this:

技术分享

 

7. In "MIGX Management" --> "MIGX" tab --> click "Add item":

技术分享

 

8. In "Settings" tab, add following information.

技术分享技术分享

  • Name: serialnumber
  • "Add Item" Replacement: "Add a serial"
  • unique MIGX ID: serilanumber (remember this, later will use)

 

9. Go to "CMP-Settings" tab, add following informations:

技术分享

 

10. Go to "MIGXDB-Settings", add following informaiton:

技术分享

Because when we create the package in step 2, we cadd the custom prefix "serialnumber", so here you also need to add it. 

技术分享

You should be able to find those information in step 3.

 

11. Click "DONE", save the changes. Then you will see :

技术分享

You might have different number, but anymore, the changes are saved.

 

12. Go to "System" --> "MENU":

技术分享

 

13. Click "Create Menu" Button.

14. Fill in the following information:

技术分享

you can leave "Parent" field behind for now.

"Parameters": "serialnumber" is unique MIGXID you set in step 8.

 

15. You can drag & drop the menu you just created to anywhere you want, for example: I put it under ‘Extras‘

技术分享

 

16. Refresh the webpage, on the top menu, under ‘Extras‘, you will see:

技术分享

 

17. Click "Serialnumber", nav to the CMP.

技术分享

 

OKOKOK, mother fucker !!! This is the first step (important) you want to achieve for CMP.

 

[MODx] Build a CMP (Custom manager page) using MIGX in MODX 2.3 -- 1

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/4316593.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!