All that’s necessary for the forces of evil to win in the world is for enough good men to do nothing.
Edmund Burke
All that’s necessary for the forces of evil to win in the world is for enough good men to do nothing.
Edmund Burke
We can add preprocess function for regions such that we can add customization before rendering the region template file(.tpl.php).
Drupal 7 – Check if the current loading page is the node view page of a specific content type
Sometimes we may even want edit the template file(.tpl.php) for specific content such as a content type node view. In Omega theme, there are different regions and by default they will use the following template files.
<drupal>/sites/all/themes/omega/omega/templates
Continue reading Drupal 7 – Customize region template file for specific content type
I try to preprocess the content region of the Omega theme for a specific content type. So i have to check the content type inside the <subtheme>_alpha_preprocess_region(&$vars) function so that the preprocess modification only applies to that content type. In that case, we could make use of the menu_get_object() provided by the Drupal API.
Continue reading Drupal 7 – Check if the current loading page is the node view page of a specific content type
We have talked about how to disable certain regions using the Context module.
Drupal 7 – Disable certain regions by conditions using Context
But seems that it may not work for certain themes and regions. Luckily, there is another module called Delta which could be served as an alternative. Delta not only could disable the region but it could alter any theme settings for specific context condition. Let’s take a look now.
Continue reading Drupal 7 – Disable certain regions by conditions using Context and Delta
Context could help you to manage the layout. In the past, i would use the Page manager of Chaos Tool Suite and Panels to control the layout but now i have completely move to the Context module. You can decide which regions should be hidden.
However, i found that it may not work for certain regions and so i raise it in the Context project page. I will keep my eyes on it.
Context – Disable regions
Continue reading Drupal 7 – Disable certain regions by conditions using Context
Here is an example which styles an HTML a link with a rounded corner button background.
Continue reading CSS3 – Rounded corner button background
When we create content type, sometimes we may want to have a combo field which is one single field contains more than one value. This can be done by using the Field collection module.
1. Download and enable the Field collection module.

Continue reading Drupal 7 – Combo field for content type
德國之旅的最後一天,雖然在Mainz睡了兩天但還未遊歷過這古城,所以在上機前的上午在這裡閒逛一會。
從前住在Mainz的民族是凱爾特人(Celts)。直到元前13年奧古斯都Augustus Caesar的繼子Nero Claudius Drusus為了守衛羅馬帝國(Roman Empire)高盧(Gallia/Gaul)一帶的領土來到此地,建立兵營Mogontiacum,但亦有研究指Mogontiacum建於更早時間。Mogontiacum一字來至凱爾特人的神Mogons/Moguns。
公元前9年羅馬軍隊在Mainz豎立了Drususstein(Drusus Stone)紀念逝世的Nero Claudius Drusus。公元89年Mainz成為羅馬帝國上日耳曼尼亞(Germania Superior)省的首府。
Continue reading 2011 – Germany Journey Review @ 6
在回程的火車上突然決定到經過了三次的Koblenz一遊,但由於時間關係能走馬看花一遊。加上太陽已落山,所以都拍不到清晰的相片,只好借Wikipedia幾幅相一用。
Koblenz這字源至拉丁語confluentes,意思是兩河的匯合處。Koblenz的兩河就是萊茵河Rhine與莫色耳河(英語: Moselle/德語: Mosel),兩河匯合之處建有Koblenz的地標德意志角(Deutsches Eck)。是紀念德意志帝國(German Empire)的第一任皇帝William I統一德國。
旅遊書上提到「父河萊茵與母河莫色耳」,但網上亦有人說母河是多瑙河(英語: Danube/德語: Donau),但我找不到任何英文source有關德國人的母河,於是便請教一位在德國留學的朋友請他轉問當地人,才知道德國人自己並沒有德國父母河的概念,但在德國的詩中可以找到Vater Rhein, Mutter Donau與Mutter Mosel,Vater和NMutter就是Father和Mother,所以萊茵河Rhine其實有兩位太太。
Continue reading 2011 – Germany Journey Review @ 5