Posted: September 22nd, 2009 | Author: Aaron K. | Filed under: Websites | Tags: development, ecommerce, magento, php | 7 Comments »
Magento has a setting in admin under System > Configuration > Web > Default Pages called “Default Web Url”. Normally this is set to a value of cms, and you specify which CMS page to use in the next option “CMS Home Page”. Magento (of course!) doesn’t use the Default Web Url as you would expect – it is not a simple url string that will redirect the visitor. If you’ve tried to set this to land your users, for example, on a category or product page, you’ll have found out it doesn’t work the way you might think.
The Default Web Url value is interpreted by Magento using the three-part front controller scheme that runs the entire site. The format is like this: frontname/controllername/actionname and you can only have up to three parts specified, the way it’s interpreted (as of 1.3.2.3). For those who aren’t familiar with this scheme, here’s a very brief overview. (visit http://alanstorm.com/magento_controller for a more in-depth discussion) The frontname is defined in a module’s config.xml file. Look in the frontend section under routers and you’ll find a frontName tag. (Magento core modules are all under /app/code/core/Mage). The frontname routes the request to the module’s front controller, which are in the corresponding ModuleName/controllers directory. In there are all the controller files, named as ControllernameController.php and inside those files are the action methods, named actionnameAction().
Throughout the code examples below, replace Mycompany and Mymodule with whatever names you want to use. Be sure to pay attention to capitalization; it’s important and it’s not necessarily consistent or intuitive!
To set up a module that will let you redirect an incoming root website link to wherever you want, first set up a module xml file under /app/etc/modules/Mycompany_Mymodule.xml containing this code:
<?xml version="1.0"?>
<config>
<modules>
<Mycompany_Mymodule>
<active>true</active>
<codePool>local</codePool>
</Mycompany_Mymodule>
</modules>
</config>
Then, create your company’s module directories:
/app/code/local/Mycompany/Mymodule
/app/code/local/Mycompany/Mymodule/controllers
/app/code/local/Mycompany/Mymodule/etc
Create your config file in /app/code/local/Mycompany/Mymodule/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Mycompany_Mymodule>
<version>0.1.0</version>
</Mycompany_Mymodule>
</modules>
<frontend>
<routers>
<mycompany>
<use>standard</use>
<args>
<module>Mycompany_Mymodule</module>
<frontName>mycompany</frontName>
</args>
</mycompany>
</routers>
</frontend>
</config>
You will see that we specify a frontend router, called mycompany, indicating that the frontName mycompany should direct the code to Mycompany_Mymodule.
Now, create the controller file in /app/code/local/Mycompany/Mymodule/controllers/PageController.php (the file can be named for whatever controllername you want to specify after the frontname on the url line, in this case the controllername would be “page” all lowercase. The file name should be your controllername with an uppercase first letter, followed by Controller.php)
<?php
class Mycompany_Mymodule_PageController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->getResponse()->setRedirect('/products.html');
}
}
Here we define a class named after your module name and front controller name. In that class we have an indexAction() method, which is what gets called if you don’t specify an action name (like mycompany/page). If you want a different action name (like mycompany/page/discounts) you would create a method called discountsAction(). In our indexAction method above, we do a simple redirect, which will send the website visitor to whatever url we want, with no Magento shenanigans to mess with us. Set the admin Default Web Url to “mycompany/page” and it will fire the indexAction and redirect our visitor! Here we have it hard-coded, but it would be simple to set up a definable config setting in admin, if you want a fully-functional module.
Posted: September 17th, 2009 | Author: Aaron K. | Filed under: General | No Comments »
The smallest shift in our own attitudes will have an impact on our lives. Seeing your life from a new perspective can show us doors that have been open for years, but we thought were closed. This new self-assessment often yields a fresh confidence, and burst of energy, which we can harness to achieve our own greatness.
What are you doing to achieve your dreams, something which should be everyone’s goal? Whatever it is, it’s difficult, and it requires a leap of faith, a belief in yourself, the confidence and chutzpah to chase after what you want and never, ever give up. I give my mother a lot of credit for digging about inside herself, and finding her strength to be who she really is. It’s hard work. It’s the most rewarding kind, however. Try it yourself, and once you’ve achieved even a little bit of your dream, you’ll never go back.
Posted: September 6th, 2009 | Author: Aaron K. | Filed under: General | Tags: development, ecommerce, magento, php, programming | No Comments »
I’m currently working with a good friend on a Magento extension, which has thrown me into the deep end of the code. As everyone else has said about Magento, the learning curve is very steep, but after it starts to make sense, the software is incredible to work with. After we’ve launched the new venture, I’ll take some time and post a few Magento tutorials – there can never be too many!
Posted: August 27th, 2009 | Author: Aaron K. | Filed under: Photography | Tags: fashion, lip service | No Comments »
Meagan takes her duty to fashion seriously.
Another set of images for a Lip Service Webzine article! It seems they like our work enough to create a regular feature, Lethal Style – penned by Vanity Kills and photographed by yours truly and a few others, depending on the circumstances. It’s quite entertaining to put these shoots together, driving around randomly in search of nifty locations. We ended up at Buffalo Central Terminal for this one, as our first choice didn’t work out. Bea and Meagan are a blast to work with, too!
Read the rest of this entry »
Posted: July 29th, 2009 | Author: Aaron K. | Filed under: Photography | Tags: fashion, goth, lip service, models, Photography | No Comments »
Bea, left, and Meagan.
Bea lounging on the lawn.
This set is from a photo shoot for a Lip Service webzine article. I first met Bea at the Auxiliary Magazine release party, where there was a Lip Service fashion show. We took some closeups for a makeup tutorial, and then went for a drive to find a good location for the fashion shots. The first stop was at the waterfront, which would have looked much better around sunset. Plus, it was too windy, and the models were too squinty in the bright sunlight. We ended up heading to the Buffalo Botanical Gardens, which offered quite a nice compliment to the mood of the clothing. Thanks to the direct sun (ick), I used a good bit of fill-flash, and it was a challenge to balance the light levels and contrast. There are a few images that I’m very happy with, shown above, and a bunch of other good ones which you can see after the jump, below.
Read the rest of this entry »
Posted: July 19th, 2009 | Author: Aaron K. | Filed under: Audio | Tags: ambient, Audio, music, studio | No Comments »
Fresh from the studio I bring you three twisted ambient soundscapes for a dark film.
Nine and a half minutes of psychotic ambient soundscape, crafted with a ghoul’s hammer in the forges of hell – or, at least, crafted by my hands with vintage synthesizers. Richard D. James would approve, I hope, and his fans will appreciate this subtly disturbing trip through a quiet alien landscape. It will make a fine backdrop to broken imagery. Please note: a subwoofer or good headphones are required to listen – it’s 90% sub-bass and you won’t hear much at all on, say, laptop speakers. This track is entitled “Isoscelation”.
[audio:aaronkondziela.com - isoscelation.mp3]
When you are exploring forbidden ruins on another plane, you cannot expect anything other than bizarre and terrifying bumps in the night. From the other room that you thought you saw, maybe just down the hall, beyond something that shouldn’t be there, it moves. Pray it didn’t smell you. This track is entitled “Mechanical Chair”.
[audio:aaronkondziela.com - mechanical chair.mp3]
You are the only one left. You did not escape unscathed. You left your friends behind, and hope for nothing more to forget them forever. Something has to play at your funeral. This track is entitled “A Long Sleep”.
[audio:aaronkondziela.com - a long sleep.mp3]
No, there is no sanity.