Vielen Dank für die Antwort. Die Includes hatte ich nicht. Jetzt werdendie Dateien schonmal beachten und mit aufgenommen. Ich bekomme jedoch immer einen Fehler sobald ich die Kategorien im Backend aufrufe. Wobei ich nicht verstehe warum er den test_store.js unter backend/category/store/test_store.js sucht. Wo er natürlich nicht liegt.
Ups! Ein Fehler ist aufgetreten!
Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.
Unable to load template snippet 'backend/category/store/test_store.js|Backend/test_plugin/view/category/main/window.js|Backend/test_plugin/controller/category/tree.js|Backend/test_plugin/controller/category/main.js|Backend/test_plugin/model/category/test_model.js|Backend/test_plugin/store/category/test_store.js|Backend/test_plugin/view/category/tabs/test_tab.js' in M:\XAMPP\htdocs\shopware\engine\Library\Smarty\sysplugins\smarty_internal_templatebase.php on line 127
Stack trace:
#0 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\View\Default.php(276): Smarty_Internal_TemplateBase->fetch()
#1 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Plugins\ViewRenderer\Bootstrap.php(216): Enlight_View_Default->render(Object(Enlight_Template_Default))
#2 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Plugins\ViewRenderer\Bootstrap.php(242): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->renderTemplate(Object(Enlight_Template_Default))
#3 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Plugins\ViewRenderer\Bootstrap.php(136): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->render()
#4 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Event\Handler\Default.php(91): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->onPostDispatch(Object(Enlight_Controller_ActionEventArgs))
#5 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Event\EventManager.php(218): Enlight_Event_Handler_Default->execute(Object(Enlight_Controller_ActionEventArgs))
#6 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Action.php(201): Enlight_Event_EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#7 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Dispatcher\Default.php(530): Enlight_Controller_Action->dispatch('loadAction')
#8 M:\XAMPP\htdocs\shopware\engine\Library\Enlight\Controller\Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#9 M:\XAMPP\htdocs\shopware\engine\Shopware\Kernel.php(191): Enlight_Controller_Front->dispatch()
#10 M:\XAMPP\htdocs\shopware\vendor\symfony\http-kernel\HttpCache\HttpCache.php(484): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 M:\XAMPP\htdocs\shopware\engine\Shopware\Components\HttpCache\AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#12 M:\XAMPP\htdocs\shopware\vendor\symfony\http-kernel\HttpCache\HttpCache.php(251): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#13 M:\XAMPP\htdocs\shopware\engine\Shopware\Components\HttpCache\AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#14 M:\XAMPP\htdocs\shopware\shopware.php(118): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#15 {main}
Hier noch die Klassen aus meinem Testprojekt (alternativ kann ich es auch gerne als zip hochladen):
TestPlugin/Controllers/Backend/TestPlugin.php
View()->assign([
'success' => true,
'data' => $result,
'total' => (int) $count,
]);
}
}
TestPlugin/Resources/views/backend/test_plugin/controller/category/main.js
//{block name="backend/category/controller/main"}
// {$smarty.block.parent}
//{include file="backend/test_plugin/store/category/test_store.js"}
Ext.define('Shopware.apps.TestPlugin.Category.controller.Main', {
override: 'Shopware.apps.Category.controller.Main',
init: function() {
var me = this;
me.callParent();
me.subApplication.testStore = me.subApplication.getStore('TestStore');
}
});
//{/block}
TestPlugin/Resources/views/backend/test_plugin/controller/category/tree.js
//{block name="backend/category/controller/tree"}
// {$smarty.block.parent}
//{include file="backend/test_plugin/view/category/tabs/test_tab.js"}
Ext.define('Shopware.apps.TestPlugin.Category.controller.Tree', {
override: 'Shopware.apps.Category.controller.Tree',
ownProductMappingRendered: false,
onItemClick: function (view, record) {
var me = this;
me.callParent(arguments);
me.categoryId = { node:record.get("id") };
var mainWindow = me.subApplication.mainWindow,
tabContainer = mainWindow.tabContainer;
me.subApplication.testStore.getProxy().extraParams = { categoryId: me.categoryId };
if(!me.ownProductMappingRendered) {
me.ownSelectorView = Ext.create('Shopware.apps.TestPlugin.view.category.tabs.TestTab', {
availableProductsStore: me.subApplication.testStore,
assignedProductsStore: me.subApplication.testStore,
record: me.detailRecord,
categoryId: me.categoryId
});
me.updateTab(tabContainer, me.ownSelectorView, false);
me.ownProductMappingRendered = true;
} else {
me.ownSelectorView.availableProductsStore = me.subApplication.testStore;
me.ownSelectorView.assignedProductsStore = me.subApplication.testStore;
me.ownSelectorView.record = me.detailRecord;
me.ownSelectorView.categoryId = me.categoryId;
me.ownSelectorView.fireEvent('storeschanged');
tabContainer.setDisabled(false);
}
}
});
//{/block}
TestPlugin/Resources/views/backend/test_plugin/model/category/test_model.js
//{block name="backend/test_plugin/model/test_model"}
Ext.define('Shopware.apps.TestPlugin.model.TestModel', {
extend:'Ext.data.Model',
fields:[
{ name: 'articleId', type: 'integer' },
{ name: 'detailArticleId', type: 'integer' },
{ name: 'name', type: 'string' },
{ name: 'number', type: 'string' },
{ name: 'supplierName', type: 'string' }
]
});
//{/block}
TestPlugin/Resources/views/backend/test_plugin/store/category/test_store.js
//{block name="backend/test_plugin/store/test_store"}
//{include file="backend/test_plugin/model/category/test_model.js"}
Ext.define('Shopware.apps.TestPlugin.store.TestStore', {
extend: 'Ext.data.Store',
remoteFilter: true,
autoLoad : false,
model : 'Shopware.apps.TestPlugin.model.TestModel',
pageSize: 20,
proxy: {
type: 'ajax',
url: '{url controller="TestPlugin" action="getArticles"}',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
}
});
//{/block}
TestPlugin/Resources/views/backend/test_plugin/vie/category/main/window.js
//{block name="backend/category/view/main/window"}
// {$smarty.block.parent}
Ext.define('Shopware.apps.TestPlugin.view.Category.main.Window', {
override: 'Shopware.apps.Category.view.main.Window',
getTabs:function () {
var me = this,
result = me.callParent();
me.tabContainer = Ext.create('Ext.form.Panel', {
title:'Eigener Tab',
disabled: true,
layout: 'fit'
});
result.push(me.tabContainer);
return result;
},
});
//{/block}
TestPlugin/Resources/views/backend/test_plugin/vie/category/tabs/test_tab.js
//{block name="backend/test_plugin/view/tabs/test_tab"}
Ext.define('Shopware.apps.TestPlugin.view.category.tabs.TestTab', {
extend:'Ext.form.Panel',
// Kopie von Shopware.apps.Category.view.category.tabs.ArticleMapping
//{/block}
Falls noch jemand eine Idee hat, wäre ich sehr dankbar.