virtuemart template override doesn't work - virtuemart

I am overriding a particular template so according to rules the data is in html folder
and in virtuemart configuration setting the default view is selected properly
as the template name , but still the overriding doesn't work?

You have to put the modified file in template folder under: /your_template/html/com_virtuemart/.
Let's say that you want to modify this file:
/components/com_virtuemart/views/productdetails/tmpl/default.php
You have to copy it to:
/templates/your_template/html/com_virtuemart/productdetails/default.php
Reference: How to override the output from the Joomla! core

Related

How to make joomla check different folder for html overrides first?

I am making system plugin for Joomla 2.5 and 3.x that should check for different html overrides folder first before the templates/template_name/html , it works well but I honestly do not like it because it is a hack that can be easily killed by joomla update. For example to override module chrome
In my plugin I have :
public function onAfterInitialise() {
JLoader::register('JModuleHelper','path to my application module helper');
}
and in my custom helper.php I changed the JModuleHelper class method renderModule() to check for html overrides in following order:
check my plugin html folder if module override file is there use it
if no override in my plugin check template html folder
if none of the above use joomla default.
joomla default is:
check my template html folder if module override file is there use it
if no override in template html, use joomla default.
isn't there an easier way to achieve this ?
Any help is appreciated. Thank you!
The best way to achieve what I am after is this
http://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core
http://extensions.joomla.org/extensions/style-a-design/templating/15611

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

I want to customize profile edit with some additional fields on database(users table) in Joomla 2.5

I tried to override profile.xml file along with edit.php (view file) by placing them within templates/template_name/html/com_users/profile folder, and also made sure the edit.php file know about new profile.xml ($this->form->loadFile( dirname(__FILE__) . DS . "profile.xml");) but i cant seem to make it work while updating custom fields from profile editing page at the front end. Also i can see that custom fields are not in order as it should be with respect to profile.xml. Please somebody help me...
You can't override an Joomla xml file. You need to create a user plugin to install separately for the form fields to appear. There is a profile plugin that comes with the default Joomla installation. Further details on this can be found here.

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.

Does Magento loads every xml file from the layout folder?

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).

Resources