<?xml version="1.0"?>
<layout version="0.1.0">
        <block type="page/html" name="nav" template="nav.phtml" parent="root" />

I have create a xml. such as this. but I can't use any of the $this-> method in the nav.phtml. Can some one tell me why? and how to fix it? thanks.

  • Not quite sure what you're asking. Do you mean there are no IDE suggestions on $this-> methods? – Anna Völkl Dec 19 '14 at 16:24
  • no, $this object is empty inside my nav.phtml. I am wondering how to call it. – wlin Dec 19 '14 at 16:35

$this in nav.phtml can only call functions from the block "page/html" which is Mage_Page_Block_Html and it's parents. You can turn on the Template Path Hints and Add Block Names to Hints from System->Configuration. Set Current Configuration Scope to your Store, then select Developer->Debug.

  • so the problem, is the type of block I am using? I am trying to do something simple as output $this->getSkinUrl('images/example.jpg') – wlin Dec 19 '14 at 16:39
  • it will only point to the base skin, instead of the custom skin I declare. – wlin Dec 19 '14 at 16:50
  • Did you configure your custom skin theme correctly in the Config settings? System->Configuration, set Current Configuration Scope, General->Design Set the Correct Package and Theme Name for your custom skin. – eetzen Dec 19 '14 at 17:09
  • yes I did, I am sure. since everything else is grab from the skin folder. – wlin Dec 19 '14 at 17:11
  • To debug this problem, just do a simple <?php echo $this->getSkinUrl('images/example.jpg') ?> and see where it's trying to get the URL from. Magento's Theme Hierarchy can help you understand how the Magento Theme works. – eetzen Dec 19 '14 at 17:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.