Model attributes visibility inside admin panel - strapi

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.

Related

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

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?

Modify component output using module......Joomla 3.0

I am a new developer in joomla.
I just want to integrate joomla component to custom module.When a user install module then output of related component must be change as per module file automatically .
I want to use filters with Jreviews_geomap_addon.So create a module to use filter icons into geomap...
Thanks
The module should have a form or link that submits or changes the URL when clicking on the links. You can then read the url parameters using:
$var_name = JFactory::getApplication()->input->get('var_name');
You can then use the $var_name to change what data is displayed by your component.

Understanding the Joomla Component File Structure / from URL

I'm new to joomla and have got a problem with a website.
I need to modify a view and I've been told it is in
http://www.example.com/index.php?option=com_user&view=register&Itemid=68
It has a registration form and i need to modify its field. I've access to FTP only. I need to know where are these files to modify the registration form. If one can describe the meaning of this url structure then it would be very helpful.
You will find the template files in /components/com_user/views/register/tmpl.
However, you should create an html/com_user folder in your template directory with a copy of those files and use a template override ("never" edit core files).
Here are a couple resources that will point you in the right direction:
http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Introduction
http://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core
com_user means use the user component register view.
Itemid 68 refers to the id of the menu item it is linked from.
You don't want to directly modify any joomla files.
If you want to add a field to registration activate the user plugin or create your own user plugin along the same design but with the fields you want.
It is advisable not to modify the core files directly, they will get overridden whenever the Joomla is updated.
However what you are looking for is available at components\com_users\models\forms\registration.xml file. you can change the default fields of the registration form in this file.
If you would like to add additional fields to registration form, there is a better way:
http://docs.joomla.org/Creating_a_profile_plugin

How to retrieve configuration values immediately after they're saved

I'm using a system.xml file to add a new section to to my Magento installation in app/code/local/NameSpace/Module/etc/system.xml. I've read that you can create an IndexController and override postAction() however of all the examples I've seen a custom layout is used rather than system.xml, is there a reason for this or can controllers be made to work for both of them?
If they can't is there any other way to have a file run after the user clicks 'Save Config' so I can immediately start using the values with Mage::getStoreConfig()?

Automatically generating Customer Attribute Form Fields

When you add customer attributes, Magento's admin dashboard for customer's automatically generates the relative form element for that new attribute.
Is there a way to do the same thing on the front end via a controller in a module?
nope, the frontend customer fields are hard coded, check out the phtml inside customer/form to see it.
What are you trying to achieve? Customer attributes are displayed on the form if "Show on frontend" is enabled. However those fields aren't saved from frontend by default. You need to extend fieldsets in your module for that, see config.xml in core Mage/Customer module
EDIT: actually that is true for enterprise edition, on CE you have to edit register.phtml (preferably by making a copy in your theme)

Resources