3

Is there a way to set a default category for tt_news, in such a way that a user don't need to explicitly assign the category when creating a news?

Charles Brunet
  • 21,797
  • 24
  • 83
  • 124

1 Answers1

4

You can set it with PageTS:

TCAdefaults.tt_news.category = 123

Make sure that editing user (if is not a admin) has proper rights to edit category field, otherwise the default category won't be saved.

Charles Brunet
  • 21,797
  • 24
  • 83
  • 124
biesior
  • 55,576
  • 10
  • 125
  • 182
  • Thank you! I wasn't able to find this information. It is sad it doesn't work then user doesn't have access to category field, but it's better than having it to explicitly select category every time. – Charles Brunet Jun 23 '12 at 18:49
  • That's normal `TCAdefaults` sets the form field not the output data, so if user has no access to it, it can not be modified. I think (didn't check it!) that should be possible use some `POST process` hook and set the MM relation even if user has no right to display the field. – biesior Jun 23 '12 at 19:05
  • 4
    If anyone looks for the same thing in tx_news: TCAdefaults.tx_news_domain_model_news.categories = 123 does the trick – Urs Sep 08 '13 at 13:19