Results 1 to 6 of 6

Thread: Default settings for new page/article

  1. #1
    New user
    Join Date
    10-19-16.
    Posts
    10

    Default Default settings for new page/article

    Hello,

    my problem is how to set some dafault settings for new pages or articles. For example all new articles shoud have enabled options "print this page" and "export to pdf".
    Actually as default this options are disabled.
    What can I do to change these settings?

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Please try this in your system/config/dcaconfig.php
    PHP Code:
    <?php
    $GLOBALS
    ['TL_DCA']['tl_article']['fields']['printable']['default'] = array('print''pdf');
    It's update safe.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    New user
    Join Date
    10-19-16.
    Posts
    10

    Default

    Thank you, that work almost as I wanted.
    Only problem is that these options are checked when I manually add new article but are unchecked when article is created automatically with new page.
    I did not find 'printable' option for tl_page.
    Do you have any solution?
    Last edited by Aga; 05/31/2017 at 11:56.

  4. #4
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Sorry, no solution for this. I opened a ticket https://github.com/contao/core/issues/8720

    Maybe you will set this field to mandatory.
    PHP Code:
    $GLOBALS['TL_DCA']['tl_article']['fields']['printable']['eval']['mandatory'] = true
    Or you will use a callback https://docs.contao.org/books/api/dca/reference.html
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  5. #5
    New user
    Join Date
    10-19-16.
    Posts
    10

    Default

    Hello,

    as I saw on github there is no easy solution for this problem?
    So I can expect that it won't be corrected soon?

  6. #6
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Yes, you have to wait till it gets fixed.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

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
  •