Results 1 to 4 of 4

Thread: Adding DCA arguements to a field

  1. #1
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default Adding DCA arguements to a field

    Hi all,
    Is it possible to add custom arguments to a field within a DCA that can be accessed by a custom widget?

    Cheers

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Adding DCA arguements to a field

    Of course. That's how all the widgets do it. The DCA and therefore anything in the array is a available.

  3. #3

    Default Re: Adding DCA arguements to a field

    Hi pbrooks,
    Hope you don't mind if continue in your thread, for what I am asking is about DCA.

    Hi Thyon,
    I once remember you wrote somewhere in forum, that DCA fields does not necessarily has to have a corresponding DB fields. can you please tell me where can i look for such examples? Thanks
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Adding DCA arguements to a field

    the DCA is just a data array that is loaded when the table is edited or a module accesses the table manually. The Contao system uses the DCA to determine how to display, edit and list the data in the DB. You can however add any variable ANYWHERE in the DCA, best place would be in the eval section, although it can be anywhere as long as it doesn't conflict with a Contao pre-set.

    The Catalog uses this method to add tons of additional variables to the system. In fact if you write a widget, it's really up to you to decide which extra parameters your should support/add and how your widget will read and respond to those settings. The backend_tabletree uses custom variables to display it's table tree in a very special way, which is completely different to a filetree or pagetree, to get that right, it adds extra icon, title and other settings in the DCA in the eval section and also in the fields parameters.

    best place to add your custom "settings":
    Code:
    'eval' => array('mandatory'=>true, 'tl_class'=>'w50', 'mynewparameter'=>'mynewvalue')

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •