Drupal Mobile Tools Memorandum
To make Mobile Tools work with mobile sub domain, there are some tricks. Say, you want to have www.example.com
for the full (desktop) site, while m.example.com is for mobile.
In that scenario, set the Mobile Tools settings as follows.
- Mobile URL -> m.example.com
- Desktop URL -> www.example.com ![]()
- Enable automatic redirection -> On (checked)
How to specify the thumbnail image for a 'Liked' page on Facebook
Here's the answer.
http://afjohnston.blogspot.com/2011/03/how-to-change-facebook-like-button.html ![]()
The gist of that is
- Use a meta tag to specify the image
- Use Facebook Debugger
to update the image, if necessary.
<meta property=”og:image” content=”your image url here”/>
How to create a menu item to a views page that is for only one language
The following link explains how to create a menu item to a views page that happens to be available only one language.
http://www.computerminds.co.uk/multilingual-views-drupal-when-using-i18n... ![]()
How to customize 'Submitted by' format on Drupal 6 with internationalization in mind
Usually, the way to customize is explained 'oh, just add the following code in template.php'.
function phptemplate_node_submitted($node) {
return t('Posted by !username, !datetime',
array(
'!username' => theme('username', $node),
'!datetime' => format_date($node->created, 'custom', 'M d, Y @ g:i A')
));
}
Translating the front page
See the link below for how to translate the front page that contains a node.
http://drupal-translation.com/content/setting-front-page-language ![]()
How to translate Title in Views
I got stuck on this for a while. Views modules doesn't support translation for its title (at least natively). There seems solutions using additional modules, but what I did is NOT to use title, but rather header
In the header section, choose PHP code filter for the input format, then write the following.
<?php global $language;
How to use sendmail (SMTP) on Windows XAMPP
XAMPP comes with sendmail, but it's not configured out of the box on Windows system. Here's how to set up sendmail with authentication for Drupal. This is useful when you have a test Druapl server locally.
- Configure php.ini
Locate your php.ini. In my case, it was C:\XAMPP\PHP\php.ini. In the [mail function] section, edit like this.
[mail function]
; For Win32 only.
Changing the order of 'links'
Seemingly a simple thing is very hard to do sometimes in Drupal. One thing is to change the order of node's links. For example, the main page lists node's teaser, where each node teaser is followed by links like "Nobu's blog", "Add new comments", and "Read More".
Allow dynamic amazon locale choice
Amazon module of Drupal is very useful when showing items, but the current implementation is limited to one locale.
There is an API level patch here.
Allow dynamic amazon locale choice
I've modified the Amazon Filter module so that I can utilize the API patch. The modification allows amazon filter to have optional locale like
[amazon 1234567890 full JP]
This will show the item from amazon.co.jp, instead of default local (usually U.S.)
<?php
function _amazon_filter_process_text($text) {
Running Drupal's cron.php without access to crontab
Drupal requires to run a scheduled task periodically. It is implemented as a php file named cron.php. If you have access to crontab on your hosting server, you just need to add cron.php to it. But what if you don't? There are a couple of ways to run cron.php without using cron on the server.
There's a module to do that, called Poormanscron (what a nice naming!)
