Thursday, July 23, 2009

Drupal template file -- Created by Yubis IT Solutions

Drupal is driven by templates file. Basically, files ended in *.tpl.php are the template files.
  • page.tpl.php
  • node.tpl.php
  • block.tpl.php
page.tpl.php controls most of the parts. For example, which CSS files are being called. It also determines what items to display (like your mission/ titles/ primary link menu bar)

node.tpl.php controls how the content should be displayed. For example, you don't want to add the comment link for the nodes, you may set it here.

block.tpl.php controls how the blocks should be displayed. Div class may be added to the blocks, which helps to let its layout be modified by CSS.

Wednesday, July 22, 2009

Padding Error -- Created by Yubis IT Solutions


This is how the tablized images appear like splitting apart!!

In the old days, a whole image used to be tablized/split into tiny pieces of images. It's really had to work it like that. In Drupal, we found that the tablized images will have "padding error", in which sense the images will just appear to be splitting apart even though no CSS is inserted. This only happens with the browsers of the new standard, not those in the old days (e.g. IE6/7)

There's a little bit of history. In the old days though not too long ago, websites are not confined to W3C standard. But then, when this standard appeared, the browser vendors had a tough choice. Option 1 is to follow strictly the standard, but this makes the website look bad. Another option is to please the design while giving up the standard.

So, 2 main modes emerged: quirk and strict. Quirk mode (old versions of IE like IE6/IE7) supports those old design, while strict mode (newer versions of IE, Firefox) supports the W3C standard and follows strictly to it.

Tablized images are really old-fashioned, and so problems occur in strict mode. The simplest solution is to force the browser to run in quirk mode. To do this, add an img tag of style: block

Of course, the easiest way to get rid of it is avoid using tablized images.

Ref: http://www.quirksmode.org/css/quirksmode.html

Tuesday, July 7, 2009

Change text into images

To change the email address/any text from text into image. This can be done automatically in Drupal using module called Textimage. I tried installing it and the result looks good. (REF: http://drupal.org/project/textimage)


The image background and font size/family can be set through this module. Auto-insertion can be done when buddled with this module. (REF: http://drupal.org/project/textimage_autoinsert)

Friday, July 3, 2009

Tools may help on customizing theme

CopyRights Reserved by Yubis IT Solution

These are very useful tools for you to trace the html code to find out the classes of element, in order to customize your design.


For FF:

Firebug:
download link: https://addons.mozilla.org/zh-TW/firefox/addon/1843



















For IE:

Internet Explorer Web Developer Tools
download link: http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en



Wednesday, July 1, 2009

Embed Youtube/ other 3party video

Instal the Drupal module called embedded video from http://drupal.org/project/emfield



After that, add this field to any content type you wanna put into. (Addr: /admin/content/node-type)

Select Manage field and then add a field called embedded video.




After that, every node created using this content type contains an embedded video field. Simply copy the youtube link like http://www.youtube.com/watch?v=K7KhcEAmCxQ&feature=related and the video can be shown. It does save steps in copying object tags to display youtube videos.




You can check what type of video could be embedded in /admin/content/emfield. Configuration can be as well done there.


PS. Not only video can be embedded, even flickr or other kinda media can be embedded. This can be achieved by enabling Embed media module from /admin/build/modules.