开发者

How to add a custom field to a form in IPB

开发者 https://www.devze.com 2023-02-06 19:56 出处:网络
Wow, I\'m quite amazed that support 开发者_JAVA技巧for Invision Power Board is so lacking (it\'s paid software!).

Wow, I'm quite amazed that support 开发者_JAVA技巧for Invision Power Board is so lacking (it's paid software!).

I just can't find the documentation for what I want to do, and I'm talking about stuff I could do in five minutes with any other forum software.

Anyway, the question: basically I need to add a custom form field (a select menu) to the 'New Topic' page in my forum. I added a select tag in the postFormTemplate template, and I've also created an hook subclassing the public_forums_post_post class. I'm overriding the saveForm function which allows me to save the value of this new field I added.

The problem is: how do I set its initial value? i.e., is there any loadForm function or something like that, which would allow me to load an initial value for the field and then communicate it to the template? I hope my question is clear enough. Please ask if you need clarification.


I agree with Endophage, though you may want to look at this article. It provides enough documentation for what you need to do.

A template hook is exactly what you need. However, if you need to add custom fields to the registration form, there's a function built-in to the ACP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号