-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Allow to define section frontend model in system configuration #1600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We have automated a Magento Contributor License Agreement verifier for contributions sent to our GitHub projects. |
What should I do this pull request has been merged? |
@@ -95,6 +95,7 @@ | |||
<xs:element name="header_css" type="xs:string" /> | |||
<xs:element name="resource" type="typeAclResourceId" /> | |||
<xs:element ref="group" /> | |||
<xs:element name="frontend_model" type="typeModel" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the attribute group for this element is defined on line 55, would it make more sense to put it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess no. It will add the attribute for <group>
node.
But I've added new element/node inside <section>
node. It is used in this function
\Magento\Config\Block\System\Config\Edit::_prepareLayout()
protected function _prepareLayout()
{
/** @var $section \Magento\Config\Model\Config\Structure\Element\Section */
$section = $this->_configStructure->getElement($this->getRequest()->getParam('section'));
$this->_formBlockName = $section->getFrontendModel();
if (empty($this->_formBlockName)) {
$this->_formBlockName = self::DEFAULT_SECTION_BLOCK;
}
...
}
And the node allows to use custom block for section rendering.
Internal ticket: MAGETWO-49794 |
[EngCom] Public Pull Requests - develop
There is ability to define/use custom block (frontend model) for system configuration section node in code. See \Magento\Config\Block\System\Config\Edit::_prepareLayout() method. But appropriate nodes are absent in system.xsd and system_file.xsd.