Archive

Posts Tagged ‘jQuery’

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 , , , , , , , , ,

A list of CMS and eCommerce systems that officially support jQuery

December 7th, 2008

Last updated: December 7th, 2008.

Recently, jQuery – the agile JavaScript Library – has reached a tipping point. Here is a list of CMS and eCommerce systems that our clients are most interested in and their status with regard to jQuery.

Systems where jQuery is officially supported:

1. Microsoft has adopted jQuery and will offer intellisense support in its dominant IDE: Visual Studio 2008.

2. Umbraco - an open source CMS now offers jQuery by default and using jQueryin Umbraco is a matter of adding a simple call in order to include the jQuery files in the page.

3. Drupal - is an open source CMS and Framework CMS, as of version 5 it offers jQuery streight from its core. There are plans to build a centralized jQuery plugin in Drupal version 7.

4. Typo3 - is an open source CMS Framework. Typo3 has a jQuery extension that allows advanced integration with jQuery.

5. DotNetNuke - an open source ASP.NET CMS. Since October 2008 DotNetNuke offers built in jQuery support beginning with version 5.

Systems where jQuery is not supported:

1. Joomla - seems to favor Mootools over jQuery. Here is an article on how to support jQuery within Joomla and avoid conflicts with other libraries.

2. Zend Framework – the leading PHP Framework following the MVC design pattern. A press release was issued in May 2008 announcing Zend Framework and Dojo partnership.

3. Magento Commerce – an open source eCommerce platform that is gaining huge market share in the eCommerce industry. Currently Magento Commerce supports prototype JS library instead of jQuery, but offers ways to integrate jQuery easily.

4. Zen-Cart - an open source eCommerce (competing with Magento). At the moment Zen-Cart is not supporting any JavaScript library in its core.

Other systems and their relationship to jQuery:

1. WordPress - an open source blogging software. Uses jQuery for its core functionality and is avilable for any third party plugin.

2. Ektron CMS400 – Ektron has an enterprise level CMS with advanced content editing features. Oddly enough, Ektron seems to have embedded their own version of jQuery in their code.

While jQuery seems to be favored the favored JavaScript library by many developers, it has yet to be declared as the default one for many projects and systems. I’ll be keeping this list updated in the following months. Let me know if there is a system that interests you and I did not list it here.

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

jQuery Emerges as Most Popular Javascript Library for Web Development

November 3rd, 2008

It seems to be official: jQuery is gaining ground faster than any other JavaScript Library. There may be many reasons but I like to think that jQuery is leading the pack due to its simplicity and relatively small size. Here is what Google Trends is showing us:

Top Reasons for jQuery’s ground gaining:

  • Simplicity.
  • Small in size: only 15K for latest production release after its minified and gzipped.
  • Extendable: pretty big plugin library. Currently showing hundreds of plugins.
  • CSS3 Compliant and one of the first JS Library to use CSS selectors.
  • Handles AJAX very well while avoiding code bloating.
  • Major adoption by ASP.NET developers and teaming up with ASP.NET’s team for improved integration

jQuery Resources:

Other Javascript Libraries:

All these Javascript frameworks provide the basic idea of single developer resource for cross browser and cross platform JavaScript development. Additionally, all make AJAX a little bit easier:

If you know of any additional interesting jQuery Resources, drop me a line. Thanks!

.NET Framework, AJAX, Web Design, Web Development, Web-based User Interfaces , , , , ,