How do I use strapi.query from within my custom admin plugin (UI)? - strapi

I have created a blank plugin via strapi generate:plugin test. Everything was created just fine and the menu item in strapi backoffice appears as expected. I have also created a custom content type "product" via strapi UI.
Now I want to query existing products from a custom view provided by my custom plugin.
I have read the documentation twice. It always suggests to use a global strapi object to access a query function strapi.query(...).
The (global) strapi object exists, but it does NOT provide the query function... What am I missing?

Related

Strapi override admin panel controller

I am interested in overriding the strapi admin panel webhook controller to give it some more functionality. e.g. Allowing customization on a per model level instead of every entity create/update/delete calling the webhook. It seems like you cant override controllers by just adding them to the admin folder like you can other parts of the admin frontend. Im looking for advice on how to proceed with this or if creating a custom plugin is my only option at this point.
Thanks, Jordy
if you want to customize the admin panel, you will have to follow this documentation - https://strapi.io/documentation/3.0.0-beta.x/concepts/customization.html
It's the same for the admin part of a plugin.

Model attributes visibility inside admin panel

Is there a way to manage model attributes visibility inside admin panel per action? Suppose I've generated Project API with name and slug attributes via the CLI. I want to hide slug from new and edit actions and use beforeCreate callback to generate it. Can I override the view or there are relative settings?
The logic used to populate admin fields is mainly contained in this file: https://github.com/wistityhq/strapi-generate-admin/blob/master/files/api/admin/public/src/strapi/explorer/explorer.service.js#L25
If you want to add specific behavior for some fields, please add custom code in this file. To do so:
cd api/admin/public/src/
npm install (node 4 required)
gulp serve
visit http://localhost:3002
edit the logic here: https://github.com/wistityhq/strapi-generate-admin/blob/master/files/api/admin/public/src/strapi/explorer/explorer.service.js#L25
finally, run gulp dist to save your updates
In a next Strapi version, admin fields display will be probably based on an external JSON file or on an adminOptions field located in each attribute of myModel.settings.json files.

Managing custom fields in appcelerator portal

When i log into the arrowdb on the appcelerator portal i can go into the "manage data" and click down to a specific user object.
I wish to edit a "custom field" in a User object.
Previously in ACS all the custom fields were available for edit, but now in arrowdb i cannot even see the custom fields only add new. If i add a new custom field for a custom field that should already exist it seems to change the value. However i want to be able to see the values too.
Am i doing something wrong? Should i edit the user object somewhere else?

Prestashop module admin panel with custom view

I need to know how to create a module on Prestashop with a custom view on admin. The documentation is very poor and I don't understand how to call a view with parameters passed by the controller. I'm using Prestashop version 1.6.
I already did these steps:
Created XML.
Created controller with constructor and install/uninstall.
Created table on DB and class.
Linked on admin menu my module.
When I go to my tab on admin panel I see a table with my db data. I need to load a custom tpl file where I can customize completely my page.
I have read so many guides and documentation (ufficial or not) but nothing clear.
Just follow the HTML and CSS in getCOntent() function in your main php file.
Whatever HTML and CSS return getContent() function will be view of your module in admin panel.
Just concentrate in getContent function of other existing module and you will get what you want.
I f you want to load a separate view than create it separate and load it in getContent() function.

How can I find the models from content type generated at using the admin Panel?

When I create a custom content type using the admin panel (as explained at http://docs.orchardproject.net/Documentation/Creating-custom-content-types), how can I find the Models for this content type in the code?
There aren't any. You created it dynamically. This doesn't generate code, but metadata that gets stored in the database.

Resources