Showing posts with label drupal. Show all posts
Showing posts with label drupal. Show all posts

Monday, February 09, 2009

Mengaktifkan PHP filter Input Format di Drupal 6

Secara default drupal 6 memang tidak mendukung input format PHP untuk memasukkan isi. Hal ini berbeda dengan Drupal 5 yang secara default mendukung fungsi ini. Lalu bagaimana? Apakah perlu tambahan module atau memang fungsi ini sudah dihilangkan?

Tenang saja, Anda tidak perlu meninggalkan Drupal 6 hanya karena masalah ini. Kita masih bisa mengisi content dengan PHP melalui drupal 6. Caranya tinggal aktifkan module PHP filter pada halaman module

Site Building => Module


Setelah itu Anda dapat menggunakannya seperti biasa

Selamat mencoba!

Wednesday, January 14, 2009

Create Block for Specifik Page on Drupal

My friend asked me to put his link on specifik page on my site that I build my site with Drupal. I thought it's very easy. Then I did that not more than minutes. His link doesn't appears to all page but only on specific page that he asked to me. So how can I do that?

For example if you want add some html script on certain term so here are what you must do. As note I use Drupal 5.xx another version maybe have same way.

First thing you must know ID (number) of the term If you don't know then let's do this.

1. Login to your drupal site
2. Go to Admin > Content Management > Categories > Choose list term on the categories that be mother of the term > Highlight or Click Edit
3. Then you will see number or ID of the term. Remember it

If you have get the ID than create a block

1. Go to Admin > Site Building > Block > Add Block
2. Save the block and edit again by click configure
3. Scroll down your browser and on the bottom you can see menu "Page specific visibility settings"

There are 3 option that you can use to show block on specific pages.
- Show on every page except the listed pages.
- Show on only the listed pages.
- Show if the following PHP code returns TRUE (PHP-mode, experts only).

If you just want show the block on specific page so choose option number 2 "Show on only the listed pages" Then on the textarea pages submit this

taxonomy/term/8

8 is ID of term. Because term located under category (taxonomy) so you must write taxonomy/term/8

4. Click Save
5. Now you can publish the block if it's not publish. It's mean you can locate block on specific section on your drupal site.

See if this is working.

Have a nice try!

Friday, December 26, 2008

Write PHP and MySQL Code on Drupal

Drupal give us ability to write PHP and MySQL script on the content or when we create block. For me this is killer facility by drupal. Until now I don't find the facility like this on other content management system or blog script.

With this ability you can write your PHP with MySQL from web without scripting. You don't need do hardcode on drupal's script file.

So this is little example on how to write PHP and MySQL code on drupal. This script will call latest submitted stories that have been publish.

<ul>
<?php
$query = "select nid, title from node where status = 1 order by nid desc limit 10";
$result = mysql_query($query) or die("Query failed");
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$url = "node/".$line['nid'];
echo "<li><a href=\"".url($url)."\" title=\"".$line['title']."\">".$line['title']."</a></li>";
}
?>
</ul>


If you want to test it or create another PHP and MySQL code, make sure that on Input format you've choose PHP Code and remember you should include tags on every PHP and MySQL that you've writen.

Have a nice try!

Tuesday, December 23, 2008

Admin Menu Module to Administrate Drupal

Admin Menu is one of drupal's modules that I like. This module is not usefull for guest or some user but very usefull for administrator or every member that give access to maintain drupal site.

This module enders all administrative menu items below 'administer' in a clean, attractive and purely CSS-based menu at the top of your website. It contains not only regular menu items - local tasks are also included, giving you extremely fast access to any administrative resource and function your Drupal installation provides.

So it's save your time to work with your drupal. You don't need back to admin home page when you want to access administration menu. Just click the menu from the drop down menu at the top of the site.

For instalation
1. Download file that suitable with your drupal version.
2. Extract the file and upload to your modules directory.
3. Go to list of modules. Site Building > Modules or visit yourdomainname.com/admin/build/modules
4. Enable module Administration Menu then click Save Configuration.
5. Now you can see there is drop down menu at the top and you can access menu on administration direcly from the drop down menu.
6. To administer admin_menu go to yourdomainname.com/admin/settings/admin_menu

Have a nice try!

Sunday, December 21, 2008

Update Drupal from 5.xx to 6.xx

Now drupal develops 3 version: 5.xx, 6.xx, and 7-beta. Drupal 7-beta still new and doesn't stable yet. So there aren't many modules or themes that compatible with drupal 7-beta. One thing that I like from Drupal 6.xx is update status module that automatically check for available updates and warn sites if they are missing security updates or newer versions. So I don't need to visit drupal.org regularry just to check if there are new updates. Drupal 5.xx also has more modules and themes then drupal 6.xx.

But if you use Drupal 5.xx and want to upgrade to Drupal 6.xx this is the tutorial:
1. Backup your database and Drupal directory. So if you get fail when upgrade, you just need restore the backup folder and database
2. Log on as the user with user ID 1
3. Place the site in "Off-line" mode, to let the database updates run without interruption and avoid displaying errors to end users of the site. You can do that from http://www.example.com/?q=admin/settings/site-maintenance (replace www.example.com with your installation's domain name and path).
4. If using a custom or contributed theme, switch to a core theme, such as Garland or Bluemarine.
5. Disable all custom and contributed modules. Remember modules and theme for drupal 5.xx are not compatible with drupal 6.xx
6. Remove all old files and directories from the Drupal 5.xx installation directory.
7. Unpack the new files and directories into the Drupal 6.xx installation directory.
8. Copy your backed up "files" and "sites" directories to the Drupal installation directory. If other system files such as .htaccess or robots.txt were customized, re-create the modifications in the new versions of the files using the backups taken in step.
9. Make sure that your new configuration file is correct.
10. Run http://www.example.com/update.php (replace www.example.com with your Drupal installation's domain name and path) from your favorite browser.
Note: if you are unable to access update.php (for example can't login with user ID 1)do the following:

- Open your settings.php with a text editor.
- Change $update_free_access = FALSE; to $update_free_access = TRUE;
- Once update.php is done, you must change the settings.php file back to its original form with $update_free_access = FALSE;

11. If you can run update.php then follow the instruction. If success you will get information about drupal database update.



12. Ensure that the versions of all custom and contributed modules and themes match the Drupal 6.xx.
13. Re-enable custom and contributed modules and themes then re-run update.php to update custom and contributed database tables.
14. Finally, return your site to "Online" mode so your visitors may resume browsing. You can do that from http://www.example.com/?q=admin/settings/site-maintenance (replace www.example.com with your installation's domain name and path).

Have a nice try!

Saturday, October 04, 2008

7 Reason to Choose Drupal Rather Than Another CMS

For first time I don't like Drupal, it's very simple on interface and complicated on admin. But after I must use Drupal to create website I falling in love with Drupal and I am brave to tell you that I choose Drupal rather than another CMS.

Why Drupal?
Below seven reasons I choose (and suggest you to use) Drupal rather than another CMS.

1. A lot of easy on administration
Drupal administration looks complicated but if we want to learn it offer a lot of easy to create website with just click here click there without change the code. For example drupal offer easy of category content, tagging, creating menu include creating menu according to category or title of the content.

2. Interface that changeable
Site with Drupal should not show content on the front page. We can create welcome letter that only can be read on the front page and the content not show on the front page. Except that we can create block that only be shown on what page and for specific user. I summary we can change drupal interface not looks like drupal.

3. Insert PHP code
This is what I like, we can create block or page with PHP code inside. This is plus value for whom understand PHP. They can express they self with PHP code without change drupal file.

4. Always Update and Easy to Update
Drupal always give new version of their engine. The new version contain fixed bugs from the older version. The bugs not just been found by contributors but user from drupal website. So they also hear the user. Update process is easy and not complicated.

5. A lot of usefull modules.
Drupal has a lot of usefull modules and add on that can make your drupal site more powerfull. You can use module for Google Adsense, Save to Bookmark, Google Analitics, SEO, and another modules.

6 Availability tutorial and help
As the bigguest CMS, tutorial and forum help aren't rare things. There are many tutorial about drupal and forums that was created to discuss drupal.

7. Good for learning tool
Drupal administration is complicated. In fact it give advantage for whom who want to develop website. Drupal's capability to create content in PHP or HTML format is also suitabale for them too.

For your information now I develop site using drupal as engine. This site is about scholarships information. You can access on www.intscholarships.com.