0

I try to specify a custom layout for my module like this:

<frontend>
...
      <layout>
            <updates>
                <learn>
                    <file>learnx.xml</file>
                <learn>
            </updates>
        </layout>
...
    </frontend>

but I get a 401 (page not found) error. I try to avoid using local.xml layout for all my local modules.

I mentiont that if i delete the above layot-update and put the same content as learnx.xml in local.xml it works.

What am I doing wrong?

Thank you!

2 Answers 2

1

It looks like you have an error in your config.xml file. You have not closed the <learn> tag for instance. Also make sure that you have the correct router information for this module which is placed before stating which layout to use. The following example should give you a clue:

<frontend>
         <routers>
            <learnx>
                  <use>standard</use>
                  <args>
                     <module>Yourpackage_Learnx</module>
                     <frontName>yourfrontname</frontName>
                  </args>
            </learnx>
         </routers>
         <layout>
            <updates>
                <learnx>
                    <file>learnx.xml</file>
                </learnx>
            </updates>
        </layout>
</frontend>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! The closing tag was the problem. :|
0

More info is needed, which file returns 401? Is it the helper that cannot be found or xml file itself?

Replacing the following tag

<learn>

with

<learnx>

may fix the error.

Magento looks up the xml file in the following order:

app/design/frontend/[interface_name]/[theme_name]/layout/learnx.xml app/design/frontend/[interface_name]/default/layout/learnx.xml app/design/frontend/base/default/layout/learnx.xml

Did you make sure you have your file on one of these locations

2 Comments

the xml seems not to be found
Yes, it is there (app/design/frontend/base/default/layout/learnx.xml).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.