Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Automatic filling database fields with values


Reply

2 Posts   1902 Views

Avatar
Jarek

29 November 2008 at 1:43am Community Member, 30 Posts

The way to edit additional db table fields in CMS is to overwrite getCMSFields function. I want to fill some fields automaticly and disable them from editing by cms users. How can I make this? I see to solutions:

1) worse - in getCMSFields fill fields witah values, and disable them from editing in cms
2) better - catch save action called when button "save & publish" pressed and set fields

First solutions is quite easy to implement. But I've no idea how make second solution.

Thx for any help

Avatar
Nivanka

29 November 2008 at 8:57am Community Member, 395 Posts

this is not hard at all, try with overriding the $defaults array,

and specify the default values you need there.

then after that in the getCMSFileds method use headerfields