prgfx / neos-linkeditor
Neos Link-Editor 扩展,用于编辑查询参数,例如编辑跟踪参数。
v0.3.0
2023-10-02 20:42 UTC
Requires
- neos/neos: ^8
- neos/neos-ui: ^8
README
Prgfx.Neos.LinkEditor
允许配置链接编辑器中的查询参数输入。旨在添加跟踪参数。
composer require prgfx/neos-linkeditor
使用方法
My.Package:NodeType: properties: text: ui: inline: editorOptions: linking: linkAttributes: # specify the label for a single query argument utm_campaign: Campaign # more options can be specified in an object utm_source: label: UTM source help: Description for this parameter # all labels accept translation IDs other: label: My.Package:Main:i18nLabel placeholder: Example value # unset attributes or attributes without label are ignored ignored_attribute: ~
分组输入
如果您有多种类型的输入,您可以以“有意义”的方式对它们进行分组
# ... linking: linkAttributes: utm_campaign: label: Campaign group: tracking
可以在前端设置中配置组
Prgfx: Neos: LinkEditor: parameterGroups: tracking: # supports MyPackage:Source:key translation keys as well label: Tracking parameters # optional; if a value is set in that group, the group will always be expanded collapsed: true
默认组名为 default
,如果您想覆盖其设置。
增强链接
对于类似的使用场景,您可能希望在特定上下文中的链接上附加额外的参数,例如在电子邮件或RSS渲染中设置“utm_source”参数。为此,您可以覆盖 Prgfx.Neos.LinkEditor:AdditionalArguments
融合原型
prototype(My.Package:RssItem) {
prototype(Prgfx.Neos.LinkEditor:AdditionalArguments) {
utm_source = 'rss'
}
}
这些属性将被添加到通过 Neos.Fusion:UriBuilder
、Neos.Neos:NodeUri
和 Neos.Neos:ConvertUris
的链接中。您可以通过相应的设置禁用此行为
Prgfx: Neos: LinkEditor: augmentLinks: NodeUri: true UriBuilder: true ConvertUris: true
注意
此包覆盖了默认的 LinkEditor,以允许将额外的链接选项传递给检查器编辑器中的参数编辑器。您可以在设置中禁用此行为
Neos: Neos: Ui: frontendConfiguration: Prgfx.Neos.LinkEditor: linkEditor: replace: false
有关更多信息,请参阅包设置