The desire to create a community for Indonesian finally realized, in December 2012 I set up a forum Bersosial.com using Drupal and was getting a good response that can be seen from the many visitors who come.
Currently, its global Alexa ranking reach to 50 thousands, and entered the top 500 sites in Indonesia, quite impressive for 5 months old forum. If you are an Indonesian, you can register now here.
Danang Probo Sayekti
danpros
April 27, 2013
March 11, 2013
Comment Fragment: Rewrite and Redirect Comment Permalink
A few days ago I releasing new module to rewrite and redirect the
comment permalink to use a fragment for SEO purposes. The default Drupal
7 comment permalink has the following format,
www.example.com/comment/1#comment-1, if a node has 10 comments, each
page with the URL /comment/[comment-id] loads identical content to the
node itself.
10 comments is fine but how about 1000 comments? 1000 duplicate contents is very bad for SEO and our website may be the target of Google's sandbox. To resolve this issues than I rewrite the comment URLs to www.example.com/node/[nid]#[comment-id] or www.example.com/[pathalias]#[comment-id] than redirect the old URL format to new format.
This module name is Comment Fragment, visit module project page here.
10 comments is fine but how about 1000 comments? 1000 duplicate contents is very bad for SEO and our website may be the target of Google's sandbox. To resolve this issues than I rewrite the comment URLs to www.example.com/node/[nid]#[comment-id] or www.example.com/[pathalias]#[comment-id] than redirect the old URL format to new format.
This module name is Comment Fragment, visit module project page here.
February 16, 2013
Check if checkbox field is checked (Drupal 7 theming)
Recently, I need the following features for one of client Drupal 7 site:
There is one content type that requires option to change the layout just by using checkbox, so what is needed is an inline CSS that are added automatically if the checkbox is checked, so the CSS is added to node.tpl.php directly.
Checkbox created using Field module, the Boolean. Here's the code that I add:
Change the field_boolean with your field name.
There is one content type that requires option to change the layout just by using checkbox, so what is needed is an inline CSS that are added automatically if the checkbox is checked, so the CSS is added to node.tpl.php directly.
Checkbox created using Field module, the Boolean. Here's the code that I add:
<?php if (!empty($content['field_boolean']['#items'][0]['value']) == '1'): ?>
<style type="text/css">
... some css style here...
</style>
<?php endif; ?>Change the field_boolean with your field name.
Labels:
Drupal
January 15, 2013
Embed a view inside a node in Drupal 7
We can embed a view created by Views module inside a node in Drupal 7 with just some short code. Here is the code:
Just put that in your node.tpl.php, and don't forget to change the views name and display name with yours.
<?php
$view = views_get_view('your_view_name');
$view->set_display('your_view_display_name');
$output = $view->preview();
// now print the view.
if ($view->result) {
print views_embed_view('your_view_name', $display_id = 'your_view_display_name');
}
?>Just put that in your node.tpl.php, and don't forget to change the views name and display name with yours.
Labels:
Drupal
January 11, 2013
Top Ten Free Professional Drupal Themes
Drupal has an amazing and clean code. Support of social networking, multimedia, SSL, event calenders, document management, blogging, forums, internationalization, user management and permission features, the ease of developing, ease of external integration, complex web sites, and the quality of add-ons for enhancing functionality. Yes Drupal is for the Geeks :)
Drupal has a power, stability and performance but not a good looking, it's hard to find a nice free themes for Drupal. Good looking is one of Drupal limitations, but this days lots web designer start to try out Drupal because the excellent usability improvements from Drupal.
Drupal has a power, stability and performance but not a good looking, it's hard to find a nice free themes for Drupal. Good looking is one of Drupal limitations, but this days lots web designer start to try out Drupal because the excellent usability improvements from Drupal.
January 10, 2013
Just switch to using Disqus
Previously I was using Blogger default commenting system, and recently I decided to switch using Disqus. I did this in order to have more organized comments, and it seems Disqus protection from spammers are also much better.
Previously I remove all of the comments, a lot of comments are just spam, so this is a perfect moment to put up new platform for this blog commenting system.
No significant change in the loading speed of this blog, and I think this is the best solution I have now.
Previously I remove all of the comments, a lot of comments are just spam, so this is a perfect moment to put up new platform for this blog commenting system.
No significant change in the loading speed of this blog, and I think this is the best solution I have now.
January 4, 2013
Creating custom user login page in Drupal 7
Maybe sometimes we want a custom style for our Drupal login page, different with the existing default login page in Drupal 7, whether it's for a personal project or client requests.
Here is the simplest way to create a custom login page in Drupal 7.
First open the template.php and add the following code:
Open the user-login.tpl.php file and paste the following code:
add the wrapper such as div, span, etc. to test it. Don't forget to clear your Drupal cache.
Here is the simplest way to create a custom login page in Drupal 7.
First open the template.php and add the following code:
function yourthemename_theme() {
$items = array();
// create custom user-login.tpl.php
$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'yourthemename') . '/templates',
'template' => 'user-login',
'preprocess functions' => array(
'yourthemename_preprocess_user_login'
),
);
return $items;
}
create a new folder "templates" and than creating user-login.tpl.php file and place it inside.Open the user-login.tpl.php file and paste the following code:
<?php
print drupal_render($form['name']);
print drupal_render($form['pass']);
print drupal_render($form['form_build_id']);
print drupal_render($form['form_id']);
print drupal_render($form['actions']);
?>
add the wrapper such as div, span, etc. to test it. Don't forget to clear your Drupal cache.
Labels:
Drupal
Subscribe to:
Posts
(
Atom
)