I want to add labels in create topic form fields is there any plugin available or any custom solution?
Do you mean a template so when a user creates a new topic, there are pre-filled options just like we have on marketplace?
Can you share a mockup or screenshot of where you want these fields?
Not exactly sure what you mean, but if you want to change the placeholder text, you can do that in the admin Customization tab, under Text. Type the current placeholder of the field and you should be able to change it.
Do you mean this?: Topic Template Placeholder Text theme component
Attached is the design screenshot which i need to implement. My question was to add the labels with text field as shown in the design
So you just want to add labels for each of the fields?
Only fields labels and some styling.
There are numerous approaches here, but consider, in order of preference:
- CSS
- Use of plugin outlets
- jQuery/equivalent native javascript edits of the DOM (not sure how easy this will be because this is not a component, so I don’t think it will be that easy to schedule manipulation as there are no event hooks).
- altering the template https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/templates/composer.hbs
The last option is risky, because this file will probably get a lot of updates over time (last update was 7 days ago!) and you don’t normally want to be overriding templates, especially those that frequently change, as you will mask stuff from core too much and break things.
您好!
我也想做同样的事情。修改我们社区主题中的 CSS 仍然是实现此目的的推荐方法吗?我团队里有一位新的前端开发人员,我可以向他寻求帮助,但我不知道该在我们的主题 CSS 中指向哪里来帮助处理这个问题。
依我看,如果你只是想要标签,那么是的,这个建议是成立的。CSS 将是首选。
供你参考,如果原作者在收到社区建议后分享他们的解决方案那就太好了,人们回馈是件好事。
