Reputation: 1641
I am developing a component 'com_datamanager' with an "Admin Dashboard" using ElaAdmin HTML5 Admin Dashboard Template. I have been able to create a simple component with multiple views without the dashboard template and it works.
But now I am stuck at how to add the 'dashboard theme' and which section whether in the view.html.php or tmpl/default to place all the "sidebar navigation"
The navigation will hold a link to all the various views of the component such as create, edit, delete, messages, product details, product list etc and it must also appear on all the above mentioned views.
I will be glad if someone can help me. thank you
Upvotes: 0
Views: 104
Reputation: 1038
Follow below steps
Create helper file of component if you it is not already there and paste below code in your helper file of component. If file is already there only past function part.
class MyComponentHelper
{
public static function addSubmenu($vName = "")
{
JHtmlSidebar::addEntry(
JText::_('Product List'),
'index.php?option=com_mycomponent&view=products',
$vName == 'products'
);
JHtmlSidebar::addEntry(
JText::_('Product'),
'index.php?option=com_mycomponent&view=product',
$vName == 'product'
);
}
}
Now go to yours views/dashboard's view.html.php
file and paste below code before the display method call.
MyComponentHelper::addSubmenu('products');
Same code snippet will go in the product view also just change the view
Let me know if you face difficulties in this. It would be more help full if you post components file structure here.
Upvotes: 3