Does Magento loads every xml file from the layout folder? - magento

When calling $this->loadLayout() in your controller, does Magento fetches all of the xml files from the layout folders in the current design package?
I am trying to figure out how the customer login form pulls out the template from:
persistent/customer/form/login.phtml, is it because there is only a layout file: persistent.xml present?
EDIT:
I figured it out I didn't see there is a new module in 1.6.1.0 and also there are changes in model resource names

The customer login form pulls in because of the template or code block type referenced in that block's XML tag (in persistent.xml).

Related

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.

Create admin front with a simple form via a module [Magento]

I am pretty new to Magento and am trying to understand how to create admin (backend) page. I have figured how to create/define the controller and action (along with editing the config.xml).
But now the next problem at hand is to display a simple form in that page. I understand that, I have an option to create blocks and mention the blocks in a layout.xml. But from what I figure is that layout.xml needs to be present in the theme folder. Which I can't do as my magento extension will be installed and I have no access to the user's system.
So the doubt is. How to display a simple from in a backend (admin) page
without having to make any changes to the theme's layout ?
For the admin panel module you don't need to mention the block in the layout.xml of your theme, you only need it to be defined in config.xml file in your "app/code/local///etc/" and a layout file is created in "app/design/adminhtml/default/default/".inside the Block create a folder named "Adminhtml" inside it your can create your form.
Refer this
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_create_an_admin_form_module

Magento does not put category name in product url when generating google sitemap xml

How can I add category path to products' urls inside xml sitemap? I have tried to modify the following 2 files but nothing has changed. Which files should I modify?
\design\frontend\base\default\template\catalog\seo\sitemap.phtml
\code\core\Mage\Catalog\controllers\Seo\SitemapController.php
Thanks!
You shouldn't modify any files, but in a standard Magento system the file that generates the site map whose behavior you should seek to change through Magento class rewrites or additional Magento code is located in the following class/method
#File: app/code/core/Mage/Sitemap/Model/Sitemap.php
public function generateXml()
{
//...
}

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

Properly override a admin template file in Magento

I want to properly override this admin template file app/design/adminhtml/default/default/template/sales/order/create/form/address.phtml
From what I have found, the proper way is to create a layout file in a new module, set template path inside my module directory and reference that template file using reference node. But I have no clue how to do that.
I don't understand how the layout is controlled using xml as of now. Can someone show how to actually do that?
You should really create your own module, which you can then create a new template.
If you want to force is you need setTemplate() which takes your phtml path as a param. $this->getLayout()->createBlock('my_module/blockname')->setTemplate('my_module/template.phtml');
Bear in mind that the two slash notations here are different.
createBlock() is for a block, so will be in /app/code/<codePool>/My/Module/Blocks/<blockname.php>
setTemplate() is for the template, so will be in /app/design/<area>/default/default/template/template.phtml
Your <area> will be /adminhtml as you're in the admin backend.
In order to get the template working you'll need to create a new module and extend the adminhtml block file which uses this template. You'll have to find the block from the layout.xml and then you can extend the Block and specify a new template.
That's how I'd go about it, but I'm also really finding it hard to override things in the Adminhtml module.

Resources