Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I make minor text changes to a template? 
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

At the risk of provoking yet another RTFDG (Read the Designer’s Guide ... again ... and again ... and again) response ...

We installed a template for Magento, and I want to change the prepopulated text in the global search box that appears on every page. I’ve found the file, using Template Path Hints. The text is there waiting to be changed. But the file warns me not to touch it if I ever expect to update Magento.

As I understand it, all the template files are in

-- skin/frontend/default/

and

-- app/design/frontend/default

Let’s say my template is called my_new_template. My template files are therefore in

-- skin/frontend/default/my_new_template/

and

-- app/design/frontend/default/my_new_template/

And let’s say the file I want to change is

-- app/design/frontend/default/my_new_template/template/catalogsearch/form.mini.phtml

In order to keep these template files upgradable when either Magento or the template is upgraded, how do I do that? Do I make a parallel template directory and a parallel string of directories down to the file I want to edit, and edit this parallel file, not including any files that I don’t want to change?

-- app/design/frontend/default/my_new_template_modes/template/catalogsearch/form.mini.phtml

If so, how does Magento know to use this? And how does it know to use the original files if this tree doesn’t have a file it’s looking for?

And what if you want to only change one line, but still be able to have other lines in the file updated when the template is updated?

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

For the benefit of future searchers (given the passive agressive lack of response to any theming questions here) ...

This seems to work:

You can set the theme in System > Design. But if you do that and then go changing it and later update your theme, you’ll lose the changes unless you’ve done something like keep it in version control.

So you can make a duplicate of the template directories:

-- skin/frontend/default/your-theme

-- app/design/frontend/default/your-theme

Then below those you can further duplicate the directory tree only to the extent that you need to, to get a parallel location for specific files that you want to change.

Then at System > Design you set your theme to this mostly empty doppleganger theme.

When the system doesn’t find a file here, it will look to the default. But there’s a problem: The default will be the normal Magenta default. So you can rename the default to default_original, and then rename your pristine, untouched version of the theme you’re using to default.

As far as I know, you can’t tell Magento to think of the default as being some other them not named “default”. So you need to rename the pristine theme you’re using “default”. Or at any rate, it will work if you do it that way.

Then you can change the doppleganger theme to your heart’s content. If you update the theme, update the pristine “default” version.

What if an update affects a file you’ve modified in the doppleganger? You’re screwed, I’d imagine. You’d need to track it down, diff it, and update the file where it needs to be updated, but keeping your changes. Some sort of svn version control might help, but that’s beyond me.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top