Thursday, April 12, 2012

CSS fix for Chrome IE7 and IE8

In some cases we need to add browser specific css properties for the site, like separate css for IE 7 and IE8 to acheive the correct layout. To acheive that we can use different methods - 1. add custome CSS file for each browser and 2. Add custom properties in the main CSS

Here I am specifying how to add separeate css properies for Chrome, IE 7 & IE8 in the main CSS file.

Chrome

Google Chome is the fast growing web browser. Some times the site layout will break and need to alter css property for this particular browser.
To fix CSS issues for Chrome use body:nth-of-type(1) .elementOrClassName{property:value;}.
Eg: body:nth-of-type(1) .sitename{margin:20px;}
HTML
<div class="sitename"></div>

IE8

For IE8 use inline css hack "\0/".
.elementOrClassName{property:value;\0/}
Eg: .sitename{margin:20px;\0/}

IE7

* (star) can be used as the inline hack for ie7
.elementOrClassName{*property:value;}
Eg: .sitename{*margin:20px;}

IE6

_ (underscore) can be using for ie6
.elementOrClassName{_property:value;}
Eg: .sitename{_margin:20px;}

Monday, February 6, 2012

How to find parent element's id using jquery

Here I am explaining how to find the parent element's id of a html element using jquery function.


$(this).parent().attr(''id);

this jquery function will give the "id" of the given element's parent  element.


eg:


<html>
   <script>
      $("a").click(function(){
         var parentid = $(this).parent().attr(''id");
      });
   </script>
   <body>
     <div id="parent-id" class="parent-class">
       <a href="#">test</a>
     </div>
  </body>
</html>


the variable "parentid" will return the value parent-id


Thursday, February 2, 2012

How to change Favicon in blogger

Favicon is a small icon shown next to the site URL in the browser's address bar. It is available for all websites with an image type of ico. In blogger, it is an orange colored icon by default. 



By performing the following simple steps you can change this default favicon to your own icon and it will give a good and unique looks to your blog site. Before following the step you need to create your own favicon. There are lot of free favicon generating sites are available or other wise you can create by image editing tools like photoshop or gimp.

Use Blogger Admin feature

Blogger has officially launched feature to change the default favicon through admin section, in the layout tab.
1. Login to your blogger account http://www.blogger.com
2. Then goto the Layout tab
3. In this Layout tab you can see the region called favicon. Click on the edit link
4. A new window will open, there you can select favicon image stored on your computer.
NB: This feature support ico format only
5. After you have selected your image, click the save button. Blogger will automatically resize and upload your image to your blog.




Manually Update the image

For this option you need to host the favicon on a website. A lot of free image hosting sites are available in internet.

1. Login to your blogger account
2. Then goto the Template tab. Before updating the favicon please take a full back up of your blog template.
3. Click on the edit HTML link and then look for the code "<title><data:blog.pageTitle/></title>"
4. Paste the following code right after the above code
<link href=’FaviconURL’ rel=’shortcut icon’ type=’image/x-icon’/>
FaviconURL - is the website address or location where your favicon hosted.
 5. Then save the template. Blog will load with your new favicon.

Monday, December 12, 2011

How to remove LinkWithin from homepage, blogger

LinkWithin is a blog widget that appears under each post, linking to related post from your blog archive. It is an awesome "related post" service which provides users to navigate to similar and related articles in the site easily.


In home page and category pages where the multiple posts displayed , you will also see this related post of each article. This is not looking good so here I am explaining how to remove the related post widget from home page and showing this linkWithin in single posts.

  • Login to your blogger and then goto Template >> Edit HTML
  • Check Expand Widget Templates
  • Search “LinkWithin” in your template
  • Add the following lines to your code( those in Red)
<b:widget id='HTML1' locked='false' title='LinkWithin' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<data:content/>
</b:if>
</b:includable>
</b:widget>

Wednesday, October 26, 2011

How to remove option from selectbox options using Jquery

Here I am explaining how to remove an option from selectbox or combobox  options list using Jquery. Jquery is a powerful javascript library that provides a lot of predefined functions to achieve our needs.

For removing the option, using remove function(remove()).  
Add following script in onload function.

$("#selectboxid option[value='value']").remove();


selectboxid = ID of your selectbox
value = value of the option which you want to remove.


$(document).ready(function()){
   $("#select-id option[value='0']").remove();
});


Here option value 0 is removed while  the form load.

http://api.jquery.com/remove/

Saturday, October 15, 2011

Top 20 Wordpress plugins and their Drupal equivalent

Wordpress is a popular blogging platform like google blogger. It provides more flexibility than blogger. If you want setup a good looking blog site quickly without knowing more technical stuff, then Wordpress should be the most likely choice for you . It provides a lot of plugins that just enable to activate more user friendly functionalities.

Wordpress is a Content Management System(CMS) build around PHP and MySQL. Like Wordpress, Drupal is also a CMS build around PHP and MySQL with almost all the strengths of Wordpress. But Drupal is more developer centric and customizable and robust when compared to Wordpress and it useful for developing Medium and large Websites, other than just a blog site. 

Due to the huge fanbase and ease of programming, Wordpress has numerous plugins at its disposal. There are Drupal equivalents for most of these. Here is our take on a few popular Wordpress plugins and their equivalent Drupal modules.


1. Akismet - It is a Wordpress plugin that check your comments against the Akismet web service to see if they look like spam or not and lets you review the spam it catches under your blog's "Comments" admin screen.

 Mollom is the Drupal equivalent of Akismet and is a popular spam prevention service module. Drupal version of Akismet module also available

2. All in one SEO pack - Automatically optimizes your WordPress blog for Search Engines (Search Engine Optimization)


 Drupal has several tested and proven modules available in the Drupal core as well as in the contributed section. The most popular ones are

  1. Path – core module
  2. Pathauto
  3. Path redirect
  4. Search 404
  5. Page title
  6. Nodewords ( A new module Metatagsis on development to replace nodewords. Currently there is a quick solution to use Metatags Quick available for Drupal


3. Bad Behavior - It prevents spammers from ever delivering their junk, and in many cases, from ever reading your Wordpress site in the first place.

 Bad Behavior is available for Drupal and it is a set of PHP scripts which prevents spambots from accessing your site by analyzing their actual HTTP requests and comparing them to profiles from known spambots. It goes far beyond User-Agent and Referer, however.

4. Broken Line Checker - It will check your posts, comments and other content for broken links and missing images, and notify you if any are found.

 Link Checker is the Drupal module to detect broken hypertext links.

5. Contact Form 7 - Wordpress plugin that can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.

 Drupal has core module for Simple contact us form. Webform can be used to create any type of custom forms. It supports csv export of the collected information. It is also possible to use captcha with webforms.

6. Google Analytics for Wordpress - WordPress plugin allows you to track your blog easily and with lots of metadata.

The Google Analytics module for Drupal incorporates all the features of the Wordpress plugin for Drupal.

7.  Google XML sitemaps for Worpress - This plugin will generate a special XML sitemap which will help search engines to better index your blog.

Drupal has also a Google XML Sitemap module with the same functionality.

8. GTranslate is a Wordpress plugin that provides an automatic translation service to translate your web page with Google power. With the ability to translate over 58 available languages your site will be available to more than 98% of Internet users.

GTranslate for Drupal does the same thing in Drupal and has been coded by the same author.

9. Lightbox Plus is a Wordpress plugin that permits users to view larger versions of images, simple slide shows, videos and content all in an overlay. It uses the popular colorbox jquery plugin.

Colorbox module for Drupal will provide full integration of the colorbox plugin.

10. MapPress is is the most popular and easiest way to create great-looking Google Maps and driving directions in your Wordpress blog.

In Drupal Gmap is the advanced and complete google map solution in Drupal. If you just want a basic google map embedded in a page, use LocationMap or Simplemap as per your requirements.

11. Newsletter is a Wordpress plug-in that lets you collect subscribers on your blog with a single or double opt-in subscription process. Double opt-in is law compliant and it means the user has to confirm the subscription following simple standard instructions sent to him via email.

Simplenews Drupal module - It can be used to send newsletters. Both anonymous and authenticated users can opt-in to different mailing lists. HTML email can be send by adding the Mime Mail module.

12. NextGEN Gallery Wordpress plugin is a fully integrated Image Gallery plugin for WordPress with a slideshow option. Before I started writing the plugin I studied all the existing image and gallery plugins for WordPress. Some of them are really good and well designed, but the gap I filled was a simple administration system at the back end which can also handle multiple galleries.

There are no equivalent ready made solutions available for Drupal, though there are some modules like Fast Gallery available, it will not stand anywhere near the features provided by the nextgen gallery.

The best way to create a custom image gallery in Drupal is to use the content types, image field and views. You can use modules like DDBlock, Views_Slideshow using views and content types.

13. Redirection is a WordPress plugin to manage 301 redirections and keep track of 404 errors without requiring knowledge of Apache .htaccess files.

Path redirect is the popular alternative in Drupal

14. Simple Tags add some tools for taxonomies like Terms suggestion, Mass Edit Terms, Auto link Terms, Ajax Autocompletion, Click Terms, Auto terms, Advanced manage term
In Drupal: By default Drupal taxonomies support tags with auto-complete option. Other features like tagcloud and manage tags can be done using the
  1. Tagadalic For tagclouds
  2. Taxonomy Manager - Manage taxonomies
  3. Community tags - allow users to tag content and track it.
15. Social Plugins - Wordpress comes with the popular social plugins Addtoany and Addthis.

Both of these plugins provide share icons of the popular social bookmarking websites. Add-to-any allows integration with google analytics and Addthis allows customization of the social icons.

Both Addtoany and Addthis are available as modules for installation in Drupal to enhance your social experience while using Drupal

16. WP e-Commerce is a free WordPress Shopping Cart Plugin that lets customers buy your products, services and digital downloads online.

Ubercart is the popular tool for ecommerce applications in Drupal. It is a superior e-commerce solution available when compared to the wordpress equivalent and has tons of features.

17. WP-DB-Backup is a Wordpress plugin that allows you easily to backup your core WordPress database tables. You may also backup other tables in the same database.

In Drupal the Backup and Migrate module (is the best automated backup solution integrated with Drupal.)

18. WP Security Scan is a Wordpress plugin that scans your WordPress installation for any security vulnerabilities.

 Security review is the Drupal module that offers the same functionality will do the same kind of security check for Drupal.

19. WP-Super Cache is a Wordpress plugin that generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.

Boost is the popular alternative in Drupal for static page caching
20. Yet Another Related Posts Plugin (YARPP) gives you a list of posts and/or pages related to the current entry, introducing the reader to other relevant content on your site. 
Similar Entries is the Drupal equivalent module that can do this same task.

Thursday, October 13, 2011

Linux Bash Shell cheat sheet for beginners

Here I am sharing a Bash shell script sheet useful for Linux users who are not familiar with bash script/ Terminal commands. Script contain a list of commands and keyboard shortcuts with description, more relevant if you are an avid Ubuntu/Debian user.

Download Linux Bash Shell Cheet Sheet PDF file

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Maintained by Web Themes