Reputation: 560
I'm working on Magento modules. After few guides I managed to create module that says "hellow world". Also I have made some of css code that add simple image border around whole page.
So the problem is: how to combine them together? I want that when I install my module, image border appears around page. What should I be looking for? Any tips? I need right path to look for answers
T.y.
Upvotes: 0
Views: 37
Reputation: 166066
You need to to
Create a module
That modifies the global layout such that your CSS is added to the page
Re: number two, there's multiple ways to go about doing this. These days I favor the event/observer method
Add an observer for the controller_action_layout_generate_blocks_after
event
Fetch the head
block from the layout in your observer method
If you find a head block, add your CSS file to it programtically
The more traditional way is
Configure you module to include an additional layout update XML file
In the default
handle of your new layout update XML file, add XML that tells Magento to add your CSS file
That should give you enough to google on and come back with more specific questions. Good luck!
Upvotes: 1