Results 1 to 9 of 9

Thread: add field in tl_page palettes

  1. #1
    User
    Join Date
    09-15-09.
    Location
    France
    Posts
    98

    Default add field in tl_page palettes

    Hello,
    I want to add the field in the page form with a extension.
    But I don't have the error message...
    Code:
    // Modify palette
    $GLOBALS['TL_DCA']['tl_page']['palettes']['default'] = str_replace('alias', 'test_check;alias', $GLOBALS['TL_DCA']['tl_page']['palettes']['default']);
    
    // Add field
    $GLOBALS['TL_DCA']['tl_page']['fields']['test_check'] = array(
       'label'      => &$GLOBALS['TL_LANG']['tl_page']['test_check'],
       'exclude'   => true,
       'inputType'   => 'checkbox',
       'eval'      => array(
    
       )
    );
    this code is true ? ?

  2. #2
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: add field in tl_page palettes

    Have you also updated the database so test_check field exists in tl_page table?

  3. #3
    User
    Join Date
    09-15-09.
    Location
    France
    Posts
    98

    Default Re: add field in tl_page palettes

    yes.. the database is updated...

  4. #4
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: add field in tl_page palettes

    Well, the code seems to be correct. What's the problem? The field does not display?

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: add field in tl_page palettes

    what is the name of the directory that contains the extension?
    Consulenza Contao CMS https://www.intco.it

  6. #6
    User
    Join Date
    09-15-09.
    Location
    France
    Posts
    98

    Default Re: add field in tl_page palettes

    system > drop_navigation > dca > tl_page.php

    The field does not display

  7. #7
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: add field in tl_page palettes

    It should be /system/modules/drop_navigation/dca/tl_page.php

  8. #8
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: add field in tl_page palettes

    the page dca has several palettes, I think you are not showing the "default" palette

    try to add your field to the "regular" palette

    Code:
    $GLOBALS['TL_DCA']['tl_page']['palettes']['regular']
    Consulenza Contao CMS https://www.intco.it

  9. #9
    User
    Join Date
    09-15-09.
    Location
    France
    Posts
    98

    Default Re: add field in tl_page palettes

    yes ! !
    thanks ga.n

    this is the correct code :
    Code:
    $GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace('title', 'title,dn_check', $GLOBALS['TL_DCA']['tl_page']['palettes']['regular']);
    
    // Add field
    $GLOBALS['TL_DCA']['tl_page']['fields']['dn_check'] = array(
       'label'      => &$GLOBALS['TL_LANG']['tl_page']['dn_check'],
       'exclude'   => true,
       'inputType'   => 'checkbox',
       'eval'	=> array('tl_class'=>'w50')
    );

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
  •