简体   繁体   English

TYPO3 页面TS 条件“新页面”

[英]TYPO3 pageTS condition "New Page"

I am trying to make some fields read-only in the page edit form of TYPO3 (v.10.4) for users of a specific user group.我试图在 TYPO3 (v.10.4) 的页面编辑表单中为特定用户组的用户设置只读字段。 They shall be able to create and modify new pages, but must not edit existing ones.他们应能够创建和修改新页面,但不得编辑现有页面。 I have tried this to so:我试过这样做:

[usergroup("3") && page["uid"] !=0 && page["perms_userid"] != backend.user.userId]
TCEFORM.pages {
    title.config.readOnly = 1
    nav_title.config.readOnly = 1
    hidden.config.readOnly = 1
    nav_hide.config.readOnly = 1
}
[end]

The condition of page["uid"] != 0 shall avoid making fields read-only when creating a new page. page["uid"] != 0的条件应避免在创建新页面时将字段设置为只读。 Unfortunately, this does not work.不幸的是,这不起作用。 Only if i already have a page whose owner is the current user, these settings are correctly not applied.只有当我已经有一个所有者是当前用户的页面时,这些设置才会正确应用。

Is there any way to check if the currently edited page is about to be created?有什么方法可以检查当前编辑的页面是否即将创建?

It is possible using the request, which includes "edit[pages][...]=new" when creating可以使用请求,创建时包括“edit[pages][...]=new”

So This is my working condition statement:所以这是我的工作条件声明:

[usergroup("3") && !like(request.getNormalizedParams().getQueryString(), "*edit[pages][*]=new*") && page["perms_userid"] != backend.user.userId]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM