How to add page in back office module in prestashop - php

how to create new page in module back office in prestashop 1.6
and how to pass url of that new page into anchor tag.
any help appreciated.
<a id="desc-tag-new" class="list-toolbar-btn" href="#"></a>

There is a manual and a programmatic way.
If the module is for private use, you can simply go to Administration > Menus and create a new menu page by associating it with a module, class and parent.
If you want to distribute the module, you should opt for the programmatic way. You have to create an AdminController extending the ModuleAdminController class and put it in /controllers/admin/. In your module's installation method, you should create and save/add a new Tab (which extends ObjectModel, hence the save/add ambiguity depending on your PrestaShop version). You should then set the properties of the new Tab object as you would from Administration > Menus.
Keep in mind that in PrestaShop, a new Menu page is associated with a specific ObjectModel subclass.

Related

Sylius add admin Page

I'm trying to create an extra admin page in Sylius. However, the documentation does not explain how to create a new admin page. The page I want to create is a subcategory page.
I did manage to create a new route and to create a new controller, but the template uses a lot of functions that are not included in my custom Controller.
Do I need to extend my custom controller with CreatePage or something?
If your page represents a CRUD operation on an entity, then this page will help you do a basic setup.

Centralising module settings and model administration

I have a module where I need to:
Manage Models
Manage Module Settings
API Authentication
Look & Feel
Etc
For Manage Models I obviously have a ModelAdmin extension
And for the latter Manage Module Settings I've had to create a DataExtension
Though this splits up the "Module Functionality" into two sections, ModelAdmin gets its own menu item on the sidebar, but the DataExtension only adds tabs to the Settings menu item.
I've searched around but to no avail on how to consolidate my custom tabs within the same menu item that ModelAdmin creates.
Is this possible? I understand the semantics behind ModelAdmin being that it only Administers Models but surely the functionality exists where you can add tabs to the menu item it creates that aren't models?
Surely it's not an abnormal scenario
The only way you could do this would be to extend LeftAndMain (as you have mentioned).
This can be a little daunting, but LeftAndMain is basically just a container for 3 templates:
Main admin template
Left hand nav template
Main edit form
At a basic level you can just create an extension to LeftAndMain, then add a custom "EditForm" function that has the settings fields you need (as well as actions to save the data).
Then if you want it to look fancier then you can overwrite the default LeftAndMain templates in framework/admin/tempaltes.
There are some docs on this on the Silverstripe site: https://docs.silverstripe.org/en/3.4/developer_guides/customising_the_admin_interface/cms_layout/
Hope that helps a bit.

Template specific parameters for menu item in joomla

I have a menu in joomla that appears on all pages. Some of the items in the menu should be the same on every page, while others need to be dynamically updated based on the page the user is on. I am trying to create an override for the "external url" menu item type (listed under system links), that would allow me to create a menu item parameter the user could populate. Then, I could use this parameter in the menu template to determine what needs to be added to that particular link.
I understand Joomla overrides for the most part, but I can not figure out where the xml file for these system link menu items is located. If my understanding is correct, overrides should be stored in templates > myTemplate > html > com_myComponent or mod_myModule. I would assume if I knew what component the system links fall under, I could create an override for the xml file. Is this correct or way off?
TL;DR: Where is the xml file for menu item type "external url"?
It seems there is no specific xml-files for the system links, as they are defined directly in
administrator/components/com_menus/views/menutypes/view.html.php
which means there is no xml-file to override. You can, however, override the view class MenusViewMenutypes, which is defined in the view.html.php-file. This is done by writing a system plugin loading a file containing the same class. The recipe is simply and beautifully described here.

How to add grid in Magento edit tab?

I ha created a new magento module. It shows info like for example Sales/Orders grid, then on click of order there is edit(in original magento view) tabs. I have created some tabs and I want one of them to be grid, like in orders shipment, creditmemos or invoices.
How do I do that?
It's not really too much different then adding a grid to any other page. I know when I was building a module I dug into the Google Base addon that is native to Magento, I found a lot of good code there to help me understand how to implement different aspects of an admin module.
For instance my tab block overides grid, like so:
class Ssi_Crm_Block_Quotes_Edit_Tab_Bom_Product extends Mage_Adminhtml_Block_Widget_Grid
This class then overrides the standard grid functions such as _prepareCollection() and _prepareColumns() stuff that you can find documented elsewhere.

Zend Framework and custom Navigation Containers

In Zend's Documentation they write about creating Navigation Containers. But they don't explain where I should create them. Does anyone know that?
I'm also wondering if a custom Navigation Container extends or overwrites the navigation.xml file which contains the static links.
(I want to make a custom Navigation Container to add dynamic links from my database)
(I want to make a custom Navigation
Container to add dynamic links from my
database)
Create a controller plugin and initialize the containers there.
If you need, you may restrict it to run only on specific module/controller/action by creating conditions on request parameters or even switch layout if needed.
You may also create navigation container as a model, or create getNavigation() in your existing model and use in anywhere, whenever you need it.
Another solution is to create the navigation container in the view helper on the fly.
Choose the one which works best in your case (eg. depending how do you handle cache).

Categories