File tree Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1212- Added: Generator command for sample email_templates.xml file
1313- Added: Generator command for sample sections.xml file
1414- Added: Generator command for sample fieldset.xml file
15+ - Added: Generator command for sample view.xml file
1516
1617## [ 1.1.3] - 3/12/2025
1718
Original file line number Diff line number Diff line change 134134 {
135135 "command" : " magento-toolbox.generateFieldsetXmlFile" ,
136136 "title" : " Magento Toolbox: Generate Fieldset XML"
137+ },
138+ {
139+ "command" : " magento-toolbox.generateViewXmlFile" ,
140+ "title" : " Magento Toolbox: Generate View XML"
137141 }
138142 ],
139143 "menus" : {
231235 {
232236 "command" : " magento-toolbox.generateFieldsetXmlFile" ,
233237 "when" : " resourcePath =~ /app\\ /code\\ /.+\\ /.+/i"
238+ },
239+ {
240+ "command" : " magento-toolbox.generateViewXmlFile" ,
241+ "when" : " resourcePath =~ /app\\ /code\\ /.+\\ /.+/i"
234242 }
235243 ]
236244 }
Original file line number Diff line number Diff line change 1+ import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand' ;
2+ import { TemplateWizardData } from 'wizard/SimpleTemplateWizard' ;
3+ import FileHeader from 'common/xml/FileHeader' ;
4+
5+ export default class GenerateViewXmlFile extends SimpleTemplateGeneratorCommand {
6+ constructor ( ) {
7+ super ( 'magento-toolbox.generateViewXmlFile' ) ;
8+ }
9+
10+ getWizardTitle ( ) : string {
11+ return 'View XML File' ;
12+ }
13+
14+ getFileHeader ( data : TemplateWizardData ) : string | undefined {
15+ return FileHeader . getHeader ( data . module ) ;
16+ }
17+
18+ getFilePath ( data : TemplateWizardData ) : string {
19+ const [ vendor , module ] = data . module . split ( '_' ) ;
20+
21+ return `app/code/${ vendor } /${ module } /etc/view.xml` ;
22+ }
23+
24+ getTemplateName ( data : TemplateWizardData ) : string {
25+ return 'xml/blank-view' ;
26+ }
27+ }
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ export { default as GenerateCrontabXmlCommand } from './GenerateCrontabXmlComman
1818export { default as GenerateEmailTemplatesXmlCommand } from './GenerateEmailTemplatesXmlCommand' ;
1919export { default as GenerateSectionsXmlCommand } from './GenerateSectionsXmlCommand' ;
2020export { default as GenerateFieldsetXmlCommand } from './GenerateFieldsetXmlCommand' ;
21+ export { default as GenerateViewXmlFile } from './GenerateViewXmlFile' ;
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <% if (fileHeader) { -% >
3+ < %- fileHeader % >
4+ < % } - %>
5+ <config xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance"
6+ xsi:noNamespaceSchemaLocation =" urn:magento:framework:Indexer/etc/view.xsd" >
7+ </config >
You can’t perform that action at this time.
0 commit comments