Jump to content

Featured Replies

Posted

How can I add a $form->addHeader on a UINode extension?

 

Since the extension specifically calls $form->add() on the returned elements we also can't add messages, dummy rows, HTML rows, buttons, etc. 🙄

  • Author

@Esther E. @Matt

We need to be able to do the minimum, at least. Adding fields only isn’t enough.

Edited by Adriano Faria

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?

  • Author

For the header, yes. HTML message is required sometimes too.

Just now, Adriano Faria said:

For the header, yes. HTML message is required sometimes too.

Any template would work. 😉

How about adding buttons to the forms? That won't work with a template since I'd need the button near the save one. 🤔

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.

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. 😹

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?

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 by teraßyte

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.

 image.thumb.jpeg.9bb72194ce872f3c274c140e4d00da23.jpeg

Recently Browsing 0

  • No registered users viewing this page.