Archive

Posts Tagged ‘AJAX’

How to Detect if the Page is Secure in a Magento Template?

October 22nd, 2009
Comments Off

When you are designing a Magento template it is easy to overlook a simple fact: most links should not be hard-coded and you should always use the methods that are available for you like getSkinUrl() and getJsUrl(). In addition to pointing to the right root folder, these methods also point to the secure or unsecure URLs, ‘https’ and ‘http’ respectively. However, how can you detect if a URL needs to be secured or not?

herring-hall-marvin-safe

In a recent Magento project, I needed to do exactly that: find out if we are in secure or in a non secure page and point to the right jQuery file on Google CDN’s. Here is the code:

<?php if(Mage::app()->getStore()->isCurrentlySecure()): ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> 
<?php else: ?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> 
<?php endif;  ?>

The key method here is the Mage::app()->getStore()->isCurrentlySecure().

Reblog this post [with Zemanta]

Magento , ,

2009, the year of Open Source Software

January 7th, 2009
Comments Off

We are lucky to live in our times. No, it is not fun going through (steep) downturn economy. But it is exciting to see the changes that such a recession will bring. One of the exciting changes that I predict for 2009 is a general boost to open source projects: increased usage and adoption by corporations while communities and ecosystems grow. Perhaps even to a point of competition with commercial products (in some cases). This is another question by itself: Can an open source project compete with a commercial product?

This year, 2009, we will see how open source projects will make huge strides and erase the gap with commercial projects, if not gain an advantage over them. Here is why:

1. Unbeatable Price: free! I know, it is not entirely true, you still need services around open source products and arguably more than in commercial products. But as the market learns to adopt more and more open source products the TCO can be lower with open source than commercial products, especially if you have the right team on your side.

2. Gain from the ‘wisdom of the crowd’, instead of wisdom of one as is often the case with commercial products. We see examples of this all over, in particular in the web development industry: Umbraco is gaining huge marketing share compared with Ektron. Magento Commerce is gaining huge market share over any other open source ecommerce platform and some of the low and mid-level commercial products in the ecommerce industry. Similar thing is happening with ASP.NET: the framework is now adopting the MVC design pattern mostly due to the fact that other platforms like Zend Framework and Ruby are free and product amazing websites. Top it off by the adoption of jQuery in almost any commercial web product today including ASP.NET framework which dumped AJAX.NET in favour of jQuery.

3. This is the sad-but-true part: developers are being laid off and hence join open source projects. It is known that the IT industry lags about 6 months after the indicators have come in, in other words, hi-tech layoffs will continue to come. In any case, more developers will be out of a job and will have plenty of time to collaborate and volunteer in open source projects – a great way to polish a resume…

To summarize, in 2009 we will see a great boost in open source adoption. Now, I am not saying that commercial products will not see any upside this year, but the competition will certainly be tougher then ever before. I am excited to see how it plays out. We certainly are going to focus our energies and our client’s energies on the leaders of each industry. You?

Content Management Systems, eCommerce, Ektron, Magento, Web Development , , , , , , , , ,