HTML and CMS blog

Magento random products block

In Magento we can create block with any content we need. For the first look Magento template system is unusual, because it consists of simple .xml files in wich is written where is situated file wich produce html output and where should be placed it's output. It's very easy. So let's begin. We need to create block with random products from current category and place it on products page. 

First we need to create appropriate file in directory /app/design/frontend/your_current_theme/default/template/catalog/product/. Lets name it list_random.phtml.

Let's look on its content:

by Anonymous
How to add author's photo into google search results

Recently, Google has created an opportunity for webmasters to distinguish your site among others in search results. One of these features - is to add pictures to your blogs result in google organic results.

Visual difference of your website is very important as it is the first thing that a potential user will notice. This small difference will increase chances that  users will go exactly to your blog.

by Anonymous Tags: photo, google, profile
Simple js/jQuery calculator creation

In some cases we need to create some kind of online calculator without sending information to server. There are a lot of plugins but they are usefull only if we need to make serious calculations in simple cases we can use our brain and jQuery api. Code given below consist of two parts: html and js.

So html we need given below:

by Anonymous
How to make menu element non clickable

Sometimes we need to make some menu items non clickable, there are some modules in drupal wich can make it , but installing module is not the easiest solution. Couple js lines given below is easiest way as i think. This way is the best when we have dropdown menu with a lot of items in different levels, only in this case our solution is very suitable. Here is code:

by Anonymous
Wordpress random comment with link to post

Task to show random comment with link to post. The decision below. First we get all approved comments. If we have comments we get random number among of existing, then we print comment content, and put link to commented post. Thats all, we spent some time to do it and we hope our solution will be useful for you.   

by Anonymous
Drupal commerce checkout pages templates

Once upon a time one developer was very upset, because he coudn't find appropriate templates name for drupal commerce checkout pages. And he began his research. Here is the result of his research.

Checkout page template: page--checkout--%.tpl.php

Checkout review page template: commerce-checkout-review.tpl.php

Page checkout complete: page--checkout--complete.tpl.php

Also will be usefull to know about user order (! one order page!!!!!) page template: page--user--orders--%.tpl.php

by Anonymous Tags: Drupal, E-commerce
Drupal commerce checkout pages templates

Once upon a time one developer was very upset, because he coudn't find appropriate templates name for drupal commerce checkout pages. And he began his research. Here is the result of his research.

Checkout page template: page--checkout--%.tpl.php

Checkout review page template: commerce-checkout-review.tpl.php

Page checkout complete: page--checkout--complete.tpl.php

Also will be usefull to know about user order (! one order page!!!!!) page template: page--user--orders--%.tpl.php

by Anonymous Tags: Drupal, commerce
How to add jQuery.noConflict() to js file

Sometimes we are using different names of main jQuery function, i mean $ and jQuery. Finally it causes some errors with js code due to name differenses. we can prevent it using this construction jQuery.noConflict(). I will show in details how we should do it. 

by Anonymous Tags: jQuery, noconflict
Drupal 7 send mail in html format

So one more time about mailing. In practice we often need to send mail in appropriate format. There are a lot of articles about this problem, especially with enormous quantity of code. As for me I tried to use it but in most cases all this code didn't work for me. My mail problem has to be solved in a short time that's why I decided to use module. I've tried a lot of them, but only mime mail http://drupal.org/project/mimemail .

by Anonymous Tags: Drupal, mail format
Send mail on form submit Drupal 7 token support

If you are going to send mail on form submit you should use simple hook_form_alter. You are able to use it in current theme template.php but it would be much easier to use custom module. in case if you are using this code in your theme template.php you should change 'yourmodule_' on 'yourtheme_'  name.

function yourmodule_form_alter(&$form, $form_state, $form_id) {
	if($form_id == 'your_form_id') {
		$form['#submit'][] = 'yourmodule_submit_webform_action';
	}
}

To add custom submit function we add new element into array:

by Anonymous

Pages