Latest from Twitter
Debugging magento templates
Posted date: 14 Oct 2011 | Posted by: admin | 0 comments
Developing in Magento without these debugging tips can be challenging, especially when you are developing a theme or want to make some modifications in backend theme.
So today, we share with you tips & tricks will help you find exactly what template(s) you need to modify to get the layout you want. It can be either frontend block or backend template!!!
- For frontend: Turn on Template Path Hints
1. Log into the admin
2. Goto -> System ->Configuration, and on the bottom of the list select “Develeper”
3. Click on Debug – you will only see “Profiler”. Here is the trick – you have to switch the “Current Configuration Scope:” [in the upper left] to a website instead of default. Select “Main Website”.
4. Now you will see the selection for Template Path Hints – check yes. This will display the path of the template for each block of the page so you can find stuff!
You can also choose to “Add Block Names to Hints” to see the corresponding model class for the block.
You will see something like this:
- For backend: It is disabled by default, so you need to turn this option on!!!
Basically, you will need to insert 2 more records into the core_config_data table for this option.
1. Connect to database
Using your favorite database administration tool like phpMyAdmin, connect to your Magento database.
2. Use the following command to put new values into ‘core_config_data’ table
INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'dev/debug/template_hints', 1), ('default', 0, 'dev/debug/template_hints_blocks', 1);
And that’s all!!!, to disable the hint, you will need to update “1″ values to “0″ (zero).