TYPO3 - 如何向输入字段添加占位符? [英] TYPO3 - How to add a placeholder to an input field?

查看:31
本文介绍了TYPO3 - 如何向输入字段添加占位符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用标准模板引擎的TYPO3 (7.2.0) 中,有没有办法在标准邮件表单文本输入中添加占位符属性?

In TYPO3 (7.2.0) using the standard template engine, is there a way to add a placeholder attribute to the standard mail form text input?

目前我正在使用 JavaScript 将标签转换为占位符,但我愿意接受关于更好的方法的建议......

At the moment I am using JavaScript to convert the labels into placeholders, but I am open to suggestions on a better way to do this...

推荐答案

@biesior 的建议解决方案仅适用于 EXT:form 7.4 及更高版本(请参阅 changelog).提供的图片显示了TYPO3 7.5 或7.6 的表单向导.在 7.2 中,您不会在向导中找到任何占位符属性.

The suggested solution of @biesior does only work for EXT:form 7.4 and higher (see changelog). The supplied picture shows the form wizard of TYPO3 7.5 or 7.6. In 7.2 you won't find any placeholder attribute in the wizard.

我建议更新到 TYPO3 7.6,因为这个版本包括对 EXT:form 的主要重写.您将能够使用流体模板来自定义表单.此外,HTML5 属性也是可能的.在重写之前,允许的属性集非常有限.现在您可以添加您能想到的所有属性(例如数据-").参见 更改日志.

I recommend updating to TYPO3 7.6 since this version includes a major rewrite of EXT:form. You will be able to use fluid templates to customize your forms. Furthermore HTML5 attributes are possible. Before the rewrite the set of allowed attributes was quite limited. Now you are able to add all attributes you can think of (for example "data-"). See changelog.

如果您对 EXT:form 有任何疑问,请加入 Slack 频道.如果您还不了解 Slack,请查看邀请功能.

If you have any questions regarding EXT:form join the channel on Slack. If you don't know Slack yet, check out the invite function.

这篇关于TYPO3 - 如何向输入字段添加占位符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆