Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
Adriano Faria Posted December 26, 2024 Posted December 26, 2024 How can I add a $form->addHeader on a UINode extension?
teraßyte Posted December 26, 2024 Posted December 26, 2024 Since the extension specifically calls $form->add() on the returned elements we also can't add messages, dummy rows, HTML rows, buttons, etc. 🙄 Adriano Faria 1
Adriano Faria Posted December 26, 2024 Author Posted December 26, 2024 (edited) @Esther E. @Matt We need to be able to do the minimum, at least. Adding fields only isn’t enough. Edited December 26, 2024 by Adriano Faria
Esther E. Posted December 26, 2024 Posted December 26, 2024 Please post this as a bug. I think I'll allow a string to be included in the array (so for example, to add a header you'd just call the header template directly, same as what $form->addHeader() does. Would that work? Adriano Faria 1
Adriano Faria Posted December 26, 2024 Author Posted December 26, 2024 For the header, yes. HTML message is required sometimes too.
Esther E. Posted December 26, 2024 Posted December 26, 2024 Just now, Adriano Faria said: For the header, yes. HTML message is required sometimes too. Any template would work. 😉 Adriano Faria 1
teraßyte Posted December 26, 2024 Posted December 26, 2024 How about adding buttons to the forms? That won't work with a template since I'd need the button near the save one. 🤔 Adriano Faria 1
Esther E. Posted December 26, 2024 Posted December 26, 2024 1 hour ago, teraßyte said: How about adding buttons to the forms? That won't work with a template since I'd need the button near the save one. 🤔 You're pushing it..... 😂 Not sure how simple that would be. Unlikely I'll add it now.
teraßyte Posted December 26, 2024 Posted December 26, 2024 13 minutes ago, Esther E. said: You're pushing it..... 😂 Not sure how simple that would be. Unlikely I'll add it now. More like I have a client with a custom modification that does exactly that... Guess I'll have to do some JS magic tricks for now. 😹
Kirill Gromov Posted December 26, 2024 Posted December 26, 2024 Don't forget form tabs! https://invisioncommunity.com/forums/topic/480849-form-tabs/
teraßyte Posted December 26, 2024 Posted December 26, 2024 2 minutes ago, Kirill Gromov said: Don't forget form tabs! https://invisioncommunity.com/forums/topic/480849-form-tabs/ You can use setPosition() on the fields to create a new tab. That's already covered at least. 🙂
Kirill Gromov Posted December 26, 2024 Posted December 26, 2024 37 minutes ago, teraßyte said: You can use setPosition() on the fields to create a new tab. That's already covered at least. 🙂 Have you tried it? Can you show me some code?
teraßyte Posted December 26, 2024 Posted December 26, 2024 (edited) Here's an example: public function formElements() : array { $newFields = array(); # Create fields $newFields['test1'] = new Text( 'test1' ); $newFields['test2'] = new Text( 'test2' ); # Call setPosition for each field $newFields['test1']->setPosition( NULL, 'TAB' ); $newFields['test2']->setPosition( 'test1', 'TAB' ); return $newFields; } You have to call setPosition() for each field to add a new tab, but it's possible. Edited December 26, 2024 by teraßyte Ryan Ashbrook, konon and Kirill Gromov 2 1
beats23 Posted December 26, 2024 Posted December 26, 2024 5 hours ago, Esther E. said: You're pushing it..... 😂 Can I push it as well 😍. Can we also have a theme template hook target for the Blog template "Section class, i-padding_3"? I would like to add the "Add message green box" below the blog post and not at the top of page, then hide the original message box with CSS. konon 1
Recommended Posts