If you want to add a UIBlock in a tab, you can do the following:
// First, save current tab pointer so you can restore it afterwards$sPreviousTab = $oPage->GetCurrentTab();// Then, set current tab pointer to the one you want to add stuff to$oPage->SetCurrentTab(OBJECT_PROPERTIES_TAB);// Then add things to the page directly, it will actually be put within the tab$oPage->AddUiBlock($YOUR_UIBLOCK);// Finally, restore current tab pointer$oPage->SetCurrentTab($sPreviousTab);
It's a bit counter-intuitive because you can directly put them in the tab, but it works.
Hope it helps,
Guillaume
👍
2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good day,
We have a custom tab for a type of object on our version of iTop.
I was wondering what I could do to pass a UIBlock into it instead of raw HTML.
Surely there's some way to convert a UIBlock into HTML? Or another method than AddToTab that can accept UIBlock?
This works, but I'm trying to build a form with itop's built in styles.
Any thoughts?
Hello Jacques,
If you want to add a UIBlock in a tab, you can do the following:
It's a bit counter-intuitive because you can directly put them in the tab, but it works.
Hope it helps,
Guillaume