Powered By Blogger

Thursday, 12 September 2013

Custom module layout file seems to be ignored

I have a couple of blocks that I’d like to include on multiple sites, so I’ve built a simple module to contain them. The problem I’m having is that the custom layout XML file that I’ve defined in the module’s config file appears to be ignored. If I place the XML from my custom layout in one of the existing XML layout files, I see my blocks. So I know that the module is generally working (at least that my blocks work correctly). But if I remove the block from an existing layout XML file and only have it in the my custom layout file, the block no longer appears.

Here is the relevant portion of my module’s config file (app/code/local/Abc/Affiliate/etc/config.xml): 



<?xml version="1.0"?><config>
    <modules>
        <Abc_Affiliate>
            <version>0.1.0</version>
        </Abc_Affiliate>
    </modules>
    <frontend>
        <routers>
            <affiliate>
                <use>standard</use>
                <args>
                    <module>Abc_Affiliate</module>
                    <frontName>affiliate</frontName>
                </args>
            </affiliate>
        </routers>
        <layout>
            <updates>
                <affiliate>
                    <file>affiliate.xml</file>
                </affiliate>
            </updates>
        </layout>
    </frontend>

    <adminhtml>
        <layout>
            <updates>
                <affiliate>
                    <file>affiliate.xml</file>
                </affiliate>
            </updates>
        </layout>
    </adminhtml>
</config>



That defines a custom layout file “affiliate.xml”. Here are the contents of that file (app/design/frontend/default/default/layout/affiliate.xml):




<?xml version="1.0"?><layout version="0.1.0">
    <default>
        <!-- Abc_Affiliate -->
        <reference name="before_body_end">
            <block type="affiliate/tracker" name="affiliate_tracker" as="affiliate_tracker" />
        </reference>
    </default>
</layout>



With the configuration set this way, I don’t see the “affiliate_tracker” block.
I’ve tried moving this portion to app/design/frontend/default/default/layout/page.xml, and then the block appears:



<reference name="before_body_end">
     <block type="affiliate/tracker" name="affiliate_tracker" as="affiliate_tracker" />
</reference>



But I don’t want to modify page.xml on multiple sites, and would like to have this layout update info in my module.

Any advice about what to change to get my module’s layout file to be recognized? Any debugging advice that may help me figure out what layout files are loaded at any particular time? 

Try adding the following file to app/etc/modules
Abc_Affiliate.xml

<config>
   <modules>
      <Abc_Affiliate>
         <active>true</active>
         <codepool>local</codepool>
      </Abc_Affiliate>
</config>


enjoy ........ :)

2 comments:

  1. HELLO GET OUT OF FINANCIAL MESS WITH THE HELP OF drbenjaminfinance@gmail.com

    I have been in financial mess for the past months, I’m a single mum with kids to look after. My name is REBECCA MICHAELSON, and am from Ridley Park, Pennsylvania. A couple of weeks ago My friend visited me and along our discussion she told me about DR BENJAMIN OWEN FINANCE of drbenjaminfinance@gmail.com that he can help me out of my financial situation, I never believed cause I have spend so much money on different loan lenders who did nothing other than running away with my money. She advised, I gave it a try because she and some of her colleagues were rescued too by this Godsent lender with loans to revive their dying businesses and paying off bills. so I mailed him and explain all about my financial situation and therefore took me through the loan process which was very brief and easy. After that my loan application worth $278,000.00USD was granted, all i did was to follow the processing and be cooperative and today I am a proud business owner sharing the testimony of God-sent Lender. You can as well reach him through the Company WhatsApp +19292227023 Email drbenjaminfinance@gmail.com

    THANK YOU VERY MUCH

    ReplyDelete
  2. Are you interested in any kinds of hacking services?
    Feel free to contact TECHNECHHACKS.

    For years now we’ve helped so many organizations and companies in hacking services.
    TECHNECHHACKS is a team of certified hackers that has their own specialties and they are five star rated hackers.

    We give out jobs to hackers (gurus only) to those willing to work, with or without a degree, to speed up the availability of time given to jobs!!

    Thus an online binary decoding exam will be set for those who needs employment under the teams establishment.


    we deal with the total functioning of sites like,


    • SOCIAL MEDIA (Facebook, Twitter, Instagram, Snapchat, google hangout etc.)

    • SCHOOL GRADES

    • IOS/OS

    • CREDIT SCORES

    • BANK ACCOUNTS

    • SPOUSES PHONE

    Our special agents are five star rated agents that specializes in the following, and will specially be assigned to you for a special job well DONE.

    • WESTERN UNION TRANSFER

    • CREDIT CARDS INSTALLATION

    • MONEY FLIPPING

    • CRIMINAL RECORDS

    • BTC RECOVERY

    • BTC MINING

    • BTC INVESTMENT

    Thus bewere of scammers because most persons are been scammed and they ended up getting all solutions to their cyber bullies and attacks by US.

    I am Jason williams one of the leading hack agent.

    PURPOSE IS TO GET YOUR JOBS DONE AT EXACTLY NEEDED TIME REQUESTED!!!



    And our WORK SUCCESS IS 100%!!!



    We’re always available for you when you need help.

    Contact or write us on:

    Technechhacks@gmail.com

    SIGNED....!

    Jason. W

    TECHNECHHACKS
    2021©️All Right Reserved

    ReplyDelete