Tuesday, January 31, 2012

Structure of the .info file in drupal theme


Contents

Drupal understands the keys listed below. Drupal will use default values for the optional keys not present in the .info file. See the examples set for core themes.
  • name required
    • name = A fantasy name
  • description recommended
    • description = Tableless multi-column theme designed for blogs.
  • screenshot
    • screenshot = screenshot.png
  • version discouraged
    • version = 2.0
  • core required
    • core = 6.x
  • engine required in most cases
    • engine = phptemplate
  • base theme
    • base theme = your theme name
  • regions
    • regions[left] = Left sidebar
    • regions[right] = Right sidebar
    • regions[content] = Content
    • regions[header] = Header
    • regions[footer] = Footer
  • Drupal 7 default regions:
    regions[header] = Header
    regions[highlighted] = Highlighted
    regions[help] = Help
    regions[content] = Content
    regions[sidebar_first] = Left sidebar
    regions[sidebar_second] = Right sidebar
    regions[footer] = Footer
  • features
    • features[] = logo
      features[] = name
      features[] = slogan
      features[] = mission
      features[] = node_user_picture
      features[] = comment_user_picture
      features[] = search
      features[] = favicon
      ; These last two disabled by redefining the
      ; above defaults with only the needed features.
      ; features[] = primary_links
      ; features[] = secondary_links

    • Drupal 7 features
      features[] = logo
      features[] = name
      features[] = slogan
      features[] = node_user_picture
      features[] = comment_user_picture
      features[] = favicon
      features[] = main_menu
      features[] = secondary_menu
         
    •    
  • stylesheets
    • stylesheets[all][] = theStyle.css
  • scripts
    • scripts[] = myscript.js
  • php

Thursday, January 19, 2012

Drupal views Filters & Exposed Filters

Another feature drupal provides is exposed filters. Exposed filters are essentially filters that are accessible to any visitor of your website, while acting just like normal filters. To use an exposed filter, you first have to create a normal filter, then click expose.
One example of exposed filters is limiting your search by keywords/taxonomy. To do this, you have to expose 2 filters: 'search:Index' and 'Taxonomy:terms'. Once you do this, you will be able to search for your words in posts with a certain keyword/taxonomy term.
As you can see, selecting a tag and using a search term gives a more accurate result than simply selecting a tag or using a search term by itself.