Tuesday, December 14, 2010

Tips for a great project page

Project pages should be helpful; there are literally thousands of modules, themes and installation profiles and site builders need a clear way to understand what your project does.

A great writeup about what to include in your project page is Module owners: How to make your module description useful by lisarex. Lisa suggests you include these sections in your project page:
  • Overview
    What does the project do? What problem does it solve? Who is the intended audience?
  • Features
    A bulleted list of features to help people quickly figure out if it's useful to them.
  • Requirements
    Describe required PHP version, link to required modules and any other extraordinary items or steps needed to install or use.
  • Known problems
    Be upfront about any known problems, bugs, etc. Link to active issues regarding those problems. Tip: use [#nnn] syntax and Drupal.org will automatically link to the issues and show their current status inside the node body.
  • Tutorials
  • Pledges
  • Credits
  • Recommended modules
  • Similar projects
For more information about Drupal Development, Drupal Expert, Drupal Developer and Drupal Programmer visit at http://www.dckap.com
Source:  http://drupal.org

Monday, December 13, 2010

Module Architecture

Presets

OpenLayers presets contain
  • Map Settings
    • Height, width
    • Centerpoint
    • OpenLayers source file, theme location, ProxyHost
  • Enabled Behaviors
  • Enabled Layers
  • Enabled Styles 
  
OpenLayers Map Views
    OpenLayers map views use the Views module merely as a way to put a map on a page. They do not, like other views, query data by themselves. To add Drupal nodes or data to a OpenLayers map view, enable openlayers_views and create a OpenLayers Map Data view, and add it as a layer.
    OpenLayers Map Views pull from OpenLayers Presets

    Layer Types

    Layer types are plugins. A base set of layer types is provided within the OpenLayers module, and other contrib modules like MapBox can provide even more. Layer Types generate Layers and provide their functionality

    Layers

    Layers are exportables which contain per-layer configuration.

    Styles

    Styles are exportables which contain OpenLayers Styles. They are attached to layers by the configuration in Presets.

    Plain-English Explanation

    Styles are exportables, as simple as that, they don't have any functionality and have a very simple interface
    Layer types are basically factories for layers and provide their functionality. They're ctools plugins, so they're loaded via that framework, but they aren't exportables because they're functional, rather than data. A layer_type generates layers, which are, in fact, exportables, which are tied back to the layer_type that created them. At runtime, a layer_type is initialized as an object (which has the all-important render() function) with a layer, to provide them with configuration and data. And layer types can also provide another function outside of this - the settings_form() allows a layer to define a per-site setting, which is most commonly an API key.

    Of course, this is a bit un-obvious with a quick glance over the code, but it's quite important, because this means that we can define new layer types outside of openlayers proper, which provide their own forms and functionality, and then make multiple layers with those layer types.

    The same goes for behaviors: behaviors are basically factory objects, since they provide the same kind of render() method and are also ctools plugins, but then give birth to instances of themselves, which are the behaviors you attach to each map. So as a result, behaviors can have per-map settings, like the zoomToLayer behavior can have a per-map setting of which layer to zoom to.

    For more information about Drupal Development, Drupal Expert, Drupal Developer and Drupal Programmer visit at http://www.dckap.com

    Source: http://drupal.org/node/621380

    Sunday, December 12, 2010

    Modifying your Drupal theme for Authcache

    The golden rule for Authcache is: the final cached page HTML must be the same for every user! For example, if you set up the "paid members" role to receive cached pages, then the final source HTML must be the same for each person for cached pages within this role.

    The most common theme element for logged-in users is a username link (e.g. "Hello, [username]"). Authcache defines several new variables to use in your theme files (e.g., page.tpl.php):
    1. $user_name to display the logged-in user name
    2. $user_link to display the name linked to their profile (both work for cached and non-cached pages).
    You'll need to modify your .tpl files to use these variables if you display a username or a link to a user's account page.

    A global variable named $is_page_authcache is set to TRUE when a page is to be cached. This variable may change to FALSE during page generation, however, such as when a status message is displayed. You may also set it to FALSE to programmatically disable caching.

    The authcache_preprocess() function defines these variables. For example, if a page is to be cached, then the output of $user_name will be <span class="authcache-user"></span>. The value will then be filled in automatically by Authcache JavaScript. The username and user id is retrieved from a cookie that is created when a user logs in.

    For more information about Drupal Development, Drupal Expert, Drupal Developer and Drupal Programmer visit at http://www.dckap.com

    Source: http://drupal.org/node/996452

    Friday, December 10, 2010

    Different ways to improve the documentation

    If you use documentation, you can also improve it.

    Whenever you seek help from the handbooks and get stuck, start taking notes. Write down every step that you take as you try to solve your problem. Don't do it later, because you'll forget the all-important details. After you find the solution, use your notes to improve the handbook. Once you develop this habit, it is a very easy way to help!

    You don't have to be a member of a special team or get permission in order to help. Everyone with a Drupal.org account can help.

    Here are ways to improve the handbooks that are available to anyone with a Drupal.org account:
    • Edit pages directly by clicking on the "Edit" tab. Most handbook pages are open to editing by Drupal.org users. We do have a number of pages that are "locked" for various reasons. Don't worry about mistakes. We keep revisions of all handbook pages so we can always go back to a previous version, if needed. 
    • Submit an issue to the "documentation" project to suggest an update or ask for feedback. See if an issue already exists for your suggestion; if so, you should improve the existing issue. For more details, see Documentation issue reports.
    • Comment on existing pages. You must be logged in (i.e. an authenticated user) to do this.
    • Add handbook pages. Presently, all authenticated users can add new pages. If you want your new page reviewed for navigation (where to place in the handbook hierarchy) or content after adding it, submit an issue with status "code needs review." For "missing" pages you feel should be created to cover a particular subject, do not create a nearly-blank stub page; instead, submit an issue with category "feature request." Be sure to familiarize yourself with the Documentation writer's guide and the Style guide.

    More information

    Here are some resources to help you out.
    • Familiarize yourself with the documentation guidelines.
    • Read Major handbook sections for a general overview of the handbooks and their structure.
    • Feel free to ask questions on the mailing list or in an issue report if you're unsure in making updates to the handbook.
    For more information about Drupal Development, Drupal Expert, Drupal Developer and Drupal Programmer visit at http://www.dckap.com

    Source: http://drupal.org/node/302203