dsqnonh2763
2014-12-16 13:24
浏览 15
已采纳

如何更改Magento商店首页的代码?

I am helping out with a Magento store initially configured by another developer who is now gone from the company, and I have no experience using Magento at all. Instead of using the built-in newsletter tools, he created an HTML form which points to a completely different server (which he owns) and now we no longer get notifications when a customer signs up for it.

Somehow, he embedded the HTML into the front page of the Store's website. I spent hours looking for the HTML and did find it, in a page called "Subscribe.phtml". I got happy, changed the code inside that page to what I want it to be, uploaded it back to the server and... nothing. No change at all to the site. I flushed the cache but that did not help.

The page does not appear to have much code in it. In CMS->Pages->Content, it shows only this:

{{block type="featuredproductslider/featuredproductslider" name="featuredproductslider"
template="magentothem/featuredproductslider/featuredproductslider.phtml"}}{{block 
type="newproduct/newproduct" name="newproduct" 
template="magentothem/newproduct/newproduct.phtml"}}

Under Design, it shows only that the layout is "3 columns". There is literally nothing else in this section.

Can you help me understand how I can change the HTML in this area to make this work? If this is helpful, here's a picture of the area that I am trying to configure:

enter image description here

Thank you.

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doujiurong7210 2014-12-17 20:03
    已采纳

    On page 44 of the manual, there's a section called "How to find out which layout file to modify". I used Template Hints and figured out where the code lived. This is what Jim was referring to. It would have been nice for someone to instruct me on how to do this.

    I set it up and found that the previous developer had modified the template directly rather than use blocks or other parts built-in to the system to modify the front page.

    打赏 评论
  • dongmale0656 2014-12-18 01:43

    You can enable template hints in the Magento configuration:

    1. Go to System->Configuration
    2. Change "Current Configuration Scope" to "Main Website"
    3. Go to Advanced->Developer
    4. Under the Debug tab, choose "Yes" for the "Template Path Hints"
    5. Save configuration.

    Now go to your homepage, refresh the page and you will see paths to all templates used on the homepage. You will then get a good idea of where each block comes from.

    It won't solve your problem, but it might help you find the right template to edit.

    打赏 评论

相关推荐 更多相似问题