Magento http upload error due to 401 authorization

Magento 401 unauthorized

If you want to ignore my blabber and just want the solution, go to the bottom of post and read the TL;DR.

This is a really strange thing to happen. I am working on a Magento project and for some testing I had to upload some images for a product. Nothing new.

Continue reading Magento http upload error due to 401 authorization

Quick Tip – TinyMCE : Use full url while inserting image

fi-tinymce

Problem:This is a common scenario. You are using tinyMCE in admin of a site to insert a link to image.  While displaying that image on frontend tinyMCE makes it relative path instead of absolute.
Solution:
When setting up tinyMCE set these 2 configuration options:

 

Both these options are true by default. As the name implies, “remove_script_host” removes the protocol and host part of URLs. “relative_urls” must be set to false is you want to set “remove_script_host” to false.

TinyMCE documentation for relative_urls and remove_script_host.

Hope it helps.

Javascript advice for beginners

As you know, Javascript can be thought of as an extension to HTML – this allows authors to incorporate some functionality into their website, from controlling webpage navigation to adding interactive content. Javascript is one of the best ways to jazz-up your webpage.

There are so many advantages of using  Javascript, so if you are right in the middle of setting up your very first website then you are sure to be interested in reading this blog post which will show you  some good Javascript books to get you started.

Javascript is used on almost all websites. Social networking sites like Facebook use it so we can post a status without leaving the page, while gaming sites like http://www.partycasino.com use it to make their content interactive, as well as animate their pages with pictures and videos. Javascript is also commonly used to record information about the user’s reading habits, like how long they stayed on a certain page and what they looked at. Let’s have a look at some handy Javascript books to get you started.

Continue reading Javascript advice for beginners

Create sharing icons for Facebook, Twitter and LinkedIn to share URLs

Social sharing icons are commonplace on websites these days. Almost every blog or website has links to share on Facebook and Twitter at least. Normally, these can be embedded by copy-pasting some JavaScript and HTML code from their respective sites. This is clearly an overhead for your web page if all you want to do is share a link from your web page.

In this post, we will see, how your can create your own sharing icons to share links on Facebook, Twitter and LinkedIn in a simple manner. Let us start now.

Continue reading Create sharing icons for Facebook, Twitter and LinkedIn to share URLs

jQueryUI Sortable-tr width reduces when used with table

I am working on a project where I need to make a list of items sortable. Naturally, I used jQueryUI’s sortable component. Now it works great for elements like ul, or ol or any other html structure.

In my case the items were in a table and I had to make the tr’s sortable. Implementing the sortable gave me the desired behavior. Here is the code I used:

But while dragging the rows, the width of cells inside currently dragged row was getting decreased, making the row appear far smaller than normal size and ugly. This is what I am talking about (note row #6):

I did a quick Google search and found the following solution which works well. You will have to use the “helper” option provided by jQuery UI api. Here is it how you use it:

Source : StackOverflow