Page 1 of 1

titleColumn function

PostPosted: Fri May 21, 2010 7:21 am
by cantlep
Hiya,

In my SiteData.php I have the following:

Code: Select all
function titleColumn(){
    return "concat(SiteData.SiteName , '[',SiteData.MPAN1,']')";
}

If "MPAN1" was held in another table (perhaps "MPANSTUFF" for example instead of SiteData) would the above concat still be possible (even though both items I want to display are in separate tables)?

Thanks

Paul

Re: titleColumn function

PostPosted: Fri May 21, 2010 8:14 am
by shannah
Yes. 2 parts. First graft the field you want onto the table using the __sql__ directive of the fields.ini file. Then you'll be able to reference it from the titleColumn() method like any other column of the table.

Re: titleColumn function

PostPosted: Fri May 21, 2010 8:23 am
by cantlep
Uber quick :-)

Many Thanks. I'd thought as much so that hopefully means that I'm finally getting to grips with Xtaface... Love it!