Hi, I created 2 packages with tables from migxdb, the modx_channels_lists and modx_programs_lists with relationship(one channel, many programs). These are the schemas of my two tables:
-modx_channels_lists
` <?xml version="1.0" encoding="UTF-8"?>
<model package="channels_lists" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.0">
<object class="Channel_List" table="channels_lists" extends="xPDOSimpleObject">
<field key="name_gr" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="name_en" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="name_tr" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="medium_name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="document_type_name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="published" dbtype="int" precision="1" phptype="integer" null="false" default="1" attributes="unsigned"/>
</object>
</model>`
-modx_programs_lists
`<?xml version="1.0" encoding="UTF-8"?>
<model package="programs_lists" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.0">
<object class="Program_List" table="programs_lists" extends="xPDOSimpleObject">
<field key="name_gr" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="name_en" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="name_tr" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="channel_id" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="published" dbtype="int" precision="1" phptype="integer" null="false" default="1" attributes="unsigned"/>
</object>
</model>`
In the table modx_programs_lists I have the channel_id column and in the CMP grid for programs you can select the channel from the listbox. In the ‘Input Option Values’ I have the query for showing the values ("@SELECT name_gr
,id
FROM [[+PREFIX]]channels_lists
"). this its ok, its showing the name_gr from the channels table but in the table content when I add new program, in the column ‘channel_id’ is showing the id and I want to display the ‘name_gr’.
I googled for a solution, but I couldn’t find any. I was hoping maybe someone here can help me.