Halaman

Senin, 05 Maret 2012

Remove Title Atributes of Menu Links from Taxonomy Generated Menu

Drupal 7: To generate menus using Taxonomy menu, we do the following steps:

1. http://mysitedom.com/admin/structure/taxonomy/my-vocabulary/list
2. Click the Edit tab
3. Select MENU location from list.
3. Check the option to "Select to rebuild the menu on submit".
4. Click the Save button, so a menu structure will be generated for the selected Vocabulary.

But I have a problem with the title attribute of URLs that are automatically filled in by the descriptions of vocabulary terms. I thought this is quite annoying, especially against the long description.

Do not hack core. This phrase is commonly heard in the Drupal community.

For my requirement, I've did this:
Modify taxonomy_menu.module file under \myhome\sites\all\modules\taxonomy_menu\ directories, to make changes of the function_taxonomy_menu_save. At line number 568-569 which contains the command:
'options' => array('attributes' => array('title' => trim($item['description'])
? $item['description'] : $item['name'])),

commenting out the line:
/* 'options' => array('attributes' => array('title' => trim($item['description'])
? $item['description'] : $item['name'])), */


After hitting my menu at http://mysitedom.com/admin/structure/menu/manage/my-taxo-menu, click Edit of each generated menu link to clear 'Description' field, I repeat the four steps above to rebuild menu, now Title attribute dissapear from menu link.



Jumat, 02 Maret 2012

Forgot Debian Root Password

Here I tell you what I did
  1. Reboot server.
  2. Press downarrow key, and grub-boot loader screen appears.
  3. I select the line start with "kernel /boot/vmlinuz-2.6.26-2.686 root=/dev/sda1 ro quiet".
  4. Press 'e' to edit the argument and modify the line to: "kernel /boot/vmlinuz-2.6.26-2.686 root=/dev/sda1 rw single init=/bin/bash"
  5. Press 'b' to boot
  6. Bash prompt appears....but I was facing the problem that the keyboard did not work..(I've got error messages something like:"Device not accepting", "Unenumerate", that tell USB port not recognized)....I am using KVM Switch. I did unplug the USB keyboard from KVM Switch then plugging in another USB keyboard.
  7. After repeating steps 1-5, I was able to type using the new keyboard.
  8. I was trying using mount command such as:
#mount -n -o remount rw /
#mount -rw -o remount /
#mount -t ext3 /dev/sda1 /usr

but passwd command failed. ("bash: passwd: command not found")
(Perhaps it would works if I (re)mount rest of all my partitions in read/write (rw) mode such as /usr /var etc, but i did not do at the time).

What I did then was disabling the root password from the password file using Nano editor. I've check that the second data field in /etc/passwd is “x” for every username, so the system uses shadow passwords, and I must edit /etc/shadow.
  1. #nano /etc/shadow
I changed==> root:this_is_the_encrypted_passwd:15401:0:99999:7:::
to this ====> root::15401:0:99999:7:::
(Edit the second data field in the password file so that it is empty.)

Reboot the system and at the login prompt, type root (without password).