Sunday, May 25, 2008

CCS media type

Reconized Media type
all
Suitable for all devices.
braille
Intended for braille tactile feedback devices.
embossed
Intended for paged braille printers.
handheld
Intended for handheld devices (typically small screen, limited bandwidth).
print
Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.
projection
Intended for projected presentations, for example projectors. Please consult the section on paged media for information about formatting issues that are specific to paged media.
screen
Intended primarily for color computer screens.
speech
Intended for speech synthesizers. Note: CSS2 had a similar media type called 'aural' for this purpose. See the appendix on aural style sheets for details.
tty
Intended for media using a fixed-pitch character grid (such as teletypes, terminals, or portable devices with limited display capabilities). Authors should not use pixel units with the "tty" media type.
tv
Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).

Media type names are case-insensitive.

Excerpted from w3.org

Example of adding *.css to a media type:

; Add a stylesheet for all media
stylesheets[all][] = theStyle.css
; Add a stylesheets for screen and projector media
stylesheets[screen, projector][] = theScreenProjectorStyle.css

Excerpted from Drupal CSS

After you modify the Theme, you need

Make Aggregated Style cleared

When working with style sheets, make sure CSS aggregation is disabled. It is located in "Administer > Site configuration > Performance". When it is enabled, any alterations will not be reflected on your site until the aggregated styles are cleared. You can enable it again when you're done.

Clear the cache

The .info file is cached. Adding or removing any styles will not be noticed until it is cleared. (Do not confuse this with the theme registry.) To have it cleared, do one of the following:

  1. Clear button located at "Administer > Site configuration > Performance".
  2. With devel block enabled (comes with devel module), click the "Empty cache" link.
  3. Simply visit the theme select page at "Administer > Site building > Themes".

Excerpted from Style Sheet at Drupal web site.

Modify Drupal Theme

For most of the people who do not involve the software development of a web site can modify Drupal practics by the following steps.

  1. Clarify what you want to change. Based on this requirement, find out related functions and templetes.
  2. Check the related functions or templetes by Devel. Refer to working with template sugesstions.
  3. Override the default functions and templetes with suggestion. Refer to Core templates and suggestions.
  4. Refer to the concept of overide if you want to have a brief idea about Drupal implementation and overide.

Clear the Theme registry

For most theme developers, the registry does not have to be dealt with directly. Just remember to clear it when adding or removing theme functions and templates. Editing existing functions and templates does not require a registry rebuild.

To clear the theme registry, do one of the following things:

  1. Clear button located at "Administer > Site configuration > Performance".
  2. With devel block enabled (comes with devel module), click the "Empty cache" link.
  3. The API function drupal_rebuild_theme_registry.

 

Excerpted from http://drupal.org/node/173880

Devel -- a good tracer between Drupal theme and modules

 

Reader: Theme developer and inquisitive admins.

Devel  is a good tracer for designer to trace between the theme and system core. It is also a good tool for checking the parameters of fuction calls.

 

Good to check the movie introducing Devel http://drupal.org/files/videocasts/moshe-theme-developer.mov.

Friday, May 23, 2008

Clean URL problem

According to the handbook of setting Clear URL

it says to put "AllowOverride All" in .htaccess.

However, I got "500 server internal error".

 

========================================

Mistake:

Note: If you have Drupal in a subdirectory (not your webroot), you need to uncomment the rewritebase option in your .htaccess file (the one provided with Drupal).

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal

I found that "AllowOverride All" is the default value. My web site mainly has problem because I use SUBDOMAIN. After I change to the orginal location in URL, there is no problem to use clearn URL.

========================================

The Subdomain module currently only supports 5.x. So I tried to install more powerful module: Domain Access.

Wednesday, May 21, 2008

A good tool for Theme development

Today, I use firebug in fireFox. It is a good tool for observation Drupal Themes.

Tuesday, May 20, 2008

Drupal Basic 1 and the references

要修改你的首頁,

site configuration -> site information
內有一個Default front page 的設定
你可以改成某一個node 的url, 某一個view, panel 的url等
以符合你的站的要求(預設是"node")

再介紹一下teaser view(摘要)
當一個頁面同時出現多個node, 或在RSS 裡設定了用摘要,
因為要避免頁面太長, 或因為排版美觀的問題
Drupal 預設是會只顯示摘要(如有),
讀者要再點摘要的標題連接, 或"Read more"
才會轉到單獨一個node 的頁面(例如本站的首頁)

至於設定teaser 的方法
可以到content management -> post settings 內設定

有某一個設定摘要的方法,
就是在你的node 的body, 加一個
Drupal 不會顯示這個tag, 但會以這個tag 為分界,
將"摘要"拿出來
我這個站的摘要都是以這個方式分隔的

excerpted from http://www.joetsuihk.com/drupal_7