How to specify a custom frontend_model inside Magento's admin interface - magento

My question is essentially the same as this one:
Add a date picker to system.xml on custom module
I'd like to add a customer frontend_model to support a date picker in Magento's admin configuration.
When I try to follow the steps in the linked post, I get an empty screen. I can see in my system.log that "Mage/" is included at the front of the file-path. Normally this would imply an improper config.xml for the relevant module, but everything I've read on frontend_model doesn't have it registered in the config.
When adding a custom frontend_model, is it necessary to register the block in config.xml?

It is not necessary to register a custom front_end model. It is necessary to reference the model by the name provided for the module.

Related

Different .phtml to diffrent type of product

I am trying to make module that switches diffrent .phtml of productview depend on attributeset name. I dont know witch file is responsible for rendering productview.
It is usually Magento Block that render template. In your case productivew is rendered by
Mage_Catalog_Block_Product_View.
You can easily figure this out by enabling template_hints and template_hints_blocks. To enable these to option follow steps below:
Go go Admin
System > Configuration
In left column, Select Developer under Advance.
Change Current Configuration Scope to website level (template_hints and template_hints_blocks is applicable at website level only)
Make yes to Template Path Hints and Add Block Names to Hints under Debug group.
you can rewrite this class:
Mage_Catalog_Block_Product_View
and then you can add your own logic to it to switch to another template, not the standard
catalog/product/view.phtml

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

File location of phtml file of backend admin page

I installed an extension to add custom fields to customer registration form.I want to add some option value in dropdown menu box of input validation in backend admin page..could you plz tell me the path of the folder where can I find the phtml file which is responsible for that part ?
-Thanks.
The files you are looking for are in:
app/design/adminhtml/default/default/template
But just changing the .phtml file won't do the job. The customer model itself should be extended to provide for your extra field. Therefore i highly recommend you to write a module for this instead of altering Magento core code. This to make sure that you can still use updates in the future.
Writing such an module requires more in depth knowledge of Magento. For more information on custom adminhtml see here.
For information on extending the core functionality look here.
If you don't feel like programming this all yourself take a look at customer attribute modules on Magento Connect.

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