Link to home
Start Free TrialLog in
Avatar of Andrew Angell
Andrew AngellFlag for United States of America

asked on

Trouble working with Magento layout files to customize a theme...???

I'm new to Magento and I'm trying to get a handle on working with layout files to customize the appearance of a page/theme.  

I'm currently working on http://magento.developersandbox.net, which is a clean install of 1.5.1 including sample data, and I've applied the Modern theme instead of the default one.

For practice, I'm simply trying to move the Popular Tags block from the left sidebar over to the right sidebar.  I turned on the template hints and it shows the following for the Popular Tags block:  frontend/base/default/template/tag/popular.phtml.

Based on what I've learned so far that tells me I need to working with the Tag module and layout file.  

As such, I opened up frontend/base/default/layout/tax.xml.  I can see the following chunk of XML that seems to be placing the block for me:

    <default>
        <!-- Mage_Tag -->
        <reference name="left">
            <block type="tag/popular" name="tags_popular" template="tag/popular.phtml"/>
        </reference>

    </default>

When I change reference name to "right", though, and then clear my Magento cache and reload the page, nothing changes.  The block still remains on the left side.

So then I think, ok, maybe I need to do this in my Modern theme since that's what I'm actually using.  So I change the original tag.xml back to the way it was (with reference left) and I opened up frontend/default/modern/layout/tag.xml.  I change this one to reference, right, and now it does indeed add the Popular Tags block to the right side, but it also leaves it on the left side so now I have it both places.

I can't seem to get a handle on this, but I feel like I'm close.  Any information on what I'm missing would be greatly appreciated.  Thanks!
Avatar of miked2004
miked2004
Flag of United States of America image

is the right sidebar even showing?
Avatar of Andrew Angell

ASKER

Yes.  As it stands right now I'm back to the default theme in Magento.  I updated frontend/base/default/layout/tag.xml so that <reference name="left"> is now <reference name="right">.  

Just like before with the modern theme, the Popular Tags block shows up on the right when I make that change, but it still strands it on the left side, too.

I've done a site-wide find to see if some other module is adding the popular tags block on the left and it doesn't find it anywhere except for the default theme, the modern theme, and the iphone theme.  

I haven't tried the iphone theme specifically, but both default and modern are acting the same way, which is that when I adjust the tag.xml file to show "right" instead of "left" it does add it on the right, but leaves on the left as well.  If I set it back to "left" it removes it from the right but leaves it on the left.
ASKER CERTIFIED SOLUTION
Avatar of miked2004
miked2004
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah, that's not working either.  

I seem to have stumbled on another thread online where somebody  is the same problem:  http://stackoverflow.com/questions/2654515/removing-the-block-popular-tags-from-the-index-view-in-magento

They get the same answers at first, but then he responds with...

"How silly, the popular tags were shown in the main page because they came in the defualt code of the content page (menu: CMS > Pages), so I just had to erase that :P"

So I'm thinking I've got the same thing going on  here, but I'm not finding what he's referring to.  
Ah, ha!  I did find it and it was exactly what he said in that other thread.  Of course that's the one block I chose to try and play with after reading about layout files!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial