Skip to content

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

Merged
merged 2 commits into from
Mar 12, 2016
Merged

Allow to define section frontend model in system configuration #1600

merged 2 commits into from
Mar 12, 2016

Conversation

ytorbyk
Copy link
Member

@ytorbyk ytorbyk commented Aug 1, 2015

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.

@vpelipenko vpelipenko added the PS label Aug 3, 2015
@magento-cicd2
Copy link
Contributor

We have automated a Magento Contributor License Agreement verifier for contributions sent to our GitHub projects.
Please see the CLA agreement in the Pull Request comments.

@ytorbyk
Copy link
Member Author

ytorbyk commented Feb 19, 2016

What should I do this pull request has been merged?
I really need this feature, I use it in my extension.

@@ -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" />
Copy link
Contributor

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?

Copy link
Member Author

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.

@dsikkema-magento
Copy link
Contributor

Internal ticket: MAGETWO-49794

@sshrewz sshrewz added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Feb 25, 2016
@magento-team magento-team merged commit 0a61429 into magento:develop Mar 12, 2016
magento-team pushed a commit that referenced this pull request Oct 19, 2017
[EngCom] Public Pull Requests - develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: accept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants