Jul 11, 2014
Apr 10, 2014
Output user profile picture programmatically in Drupal
There are many pros of using Drupal in terms of other CMS available in market, such as its:
- Extremely Flexible
- Developer Friendly
- Strong SEO
- Capabilities Enterprise
- Friendly Stability
For instance lets take the example of user profile, if someone wants to show the user profile picture in Drupal then its a complicated task for him/her. Let me simply this for you in the below code. I've created the code in such a way if the user profile picture is not set, then it will show you the default profile pic.
Code:
global $user;
if ($user->uid) {
$user = user_load($user->uid);
print theme(
'image_style',
array(
'style_name' => 'thumbnail',
'path' => !empty($user->picture->uri)?$user->picture->uri:variable_get('user_picture_default'),
'attributes' => array(
'class' => 'avatar'
)
)
);
}
Cheers!Photo Credit: Instagram
Dec 15, 2012
Website content management system – what is it all about?
CMS or the Content management system, in simple words can be explained as PC
software that helps you to amend, alter, make public and maintain the contents from
the central interface end. Initially CMS was designed with the purpose of simplifying
the complex task of writing codes of various versions and to ease up the development
process more flexible and handy. This type of software helps to manage system that
controls and manages the complete content with the help of a workflow procedure
including a collaborative environment.
CMS helps to centralize data edit, publish and modify at the single back end interface.
This web CMS technique is best used to be in charge of active set of web materials that
are made available online such as websites, media files and document.
Different types of CMS
We have three major types of Content Management System (CMS) namely, online
processing, offline processing and hybrid systems. These processes are being used
in the implementation procedure to describe the deployment pattern for Web CMS via
presentation templates that provide a structural content pattern for your web page.
Online processing system is all about implementing templates requisite condition.
Usually a web page HTML is being generated during a visitor’s entry or when the
page is being pulled off from web cache. It is known that most of the open source web
content management system has the capability to support add-ons that offers the
required support including blogs, forums, web stores, etc. It’s being referred to as add-
ons, widgets, modules, or extensions with open source of paid license model.
Offline processing system is something that is also termed as static site generators.
Pre-process all the content by implementing the right templates ahead of issuing to
generate your web pages. As pre-processing system does not call for server to make
use of the templates at the right time, they subsist as design-time tools.
Hybrid systems
There are systems where both online and offline techniques are being implemented.
Some systems write their exec codes to move on with dynamic HTML condition where
CMS is not deployed on all servers. While the other types of Hydrid systems are either
offline or online base on the functionality.
Jun 27, 2012
How to create a module in Drupal 7.x
What is a module in Drupal?
A module is nothing but a collection of functions that links into Drupal, providing all the additional functionality/behaviour for your Drupal installation or your Drupal site. After reading this tutorial, you will be able to create a basic block module and use it as a template for more advanced modules.
Things to be remember before we start:
This tutorial will not necessarily prepare you to write modules for public release it will only give you a step by step integration reagarding "How to create a module!". It does not cover caching, nor does it elaborate on permissions or security issues but you can simply use this tutorial as your starting point and extend your skills with other resources.
Our tutorial assumes you have:
- Basic PHP knowledge, including syntax and the concept of PHP objects
- Basic understanding of database tables, fields, records and SQL statements
- A working Drupal 7 installation
- Drupal administration access
- Webserver access
Our tutorial does not assume you have any knowledge about the inner workings of a Drupal module.
Getting started
In this tutorial we'll create a module that lists links to content such as blog entries or forum discussions that were created recently (within the last week). This page in the tutorial describes how to create the initial module file and directory.
Name your module
The first step in creating a module is to choose a "short name" for it. This short name will be used in all file and function names in your module, so it must start with a letter, and it must contain only lower-case letters and underscores. For this example, we'll choose "current_posts" as the short name. Important note: Be sure you follow these guidelines and do not use upper case letters in your module's short name, since it is used for both the module's file name and as a function prefix. When you implement Drupal "hooks" (see later portions of tutorial), Drupal will only recognize your hook implementation functions if they have the same function name prefix as the name of the module file.
It's also important to make sure your module does not have the same short name as any theme you will be using on the site.
Create a folder and a module file
Given that our choice of short name is "current_posts" :
- Start the module by creating a folder in your Drupal installation at the path:
sites/all/modules/custom/current_posts
- Create the PHP file for the module :
- Save it as
current_posts.module
in the directorysites/all/modules/custom/current_posts
- As of Drupal 6.x,
sites/all/modules
is the preferred place for non-core modules (andsites/all/themes
for non-core themes), because this places all site-specific files in the sites directory. This allows you to more easily update the core files and modules without erasing your customizations. Alternatively, if you have a multi-site Drupal installation and this module is for only one specific site, you can put it insites/your-site-folder/modules
.
- Save it as
- Add an opening PHP tag to the module :
<?php
- Module files begin with the opening PHP tag. Do not place the CVS ID tag in your module. It is no longer needed with drupal.org's conversion to Git. If the coder module gives you error messages about it, then that module has not yet been updated to drupal.org's Git conventions.
The module is not operational yet: it hasn't been activated. We'll activate the module later in the tutorial.
Coding standards
As per the Coding standards, omit the closing ?>
tag. Including the closing tag may cause strange runtime issues on certain server setups. (Note that the examples in documentation will show the closing tag for formatting reasons only and you should not include it in your real code.)
Telling Drupal about your module
All modules must have a 'modulename.info' file, which contains meta information about the module.
The general format is:
description = A description of what your module does.<br />
core = 7.x[/php]
For our module, we will replace 'Module Name' in the example above with the name of our module, 'Current Posts'. Without this file, the module will not show up in the module listing. Here is our specific example:
description = A block module that lists links to recent posts.<br />
core = 7.x[/php]
Add the source above to a file named current_posts.info
and save it into the module's directory at sites/all/modules/current_posts
.
Note: If you copy and paste this code block, ensure that the description data does not contain a line break (turn off word-wrap on your text-editor to be sure). Otherwise, the .info file will not parse correctly.
.Info File Details
The details of what to put in a .info file can be found on the Writing .info files page.
Comments in Drupal modules
It's always a good idea to document how your module works in comments. Drupal uses Doxygen to draw documentation from source code, so contrib modules on drupal.org follow strict comment guidelines. See Doxygen and comment formatting conventions for more details. Following these guidelines is beneficial to anyone looking at your code even if it's not strictly necessary for your situation.
Your first comment:
/**<br />
* @file<br />
* A block module that displays recent blog and forum posts.<br />
*/<br />
?>[/php]
@file signifies that this comment pertains to the entire file. The doc block begins with a slash and two asterisks (/**) and ends with one asterisk and a slash (*/). Following Drupal guidelines, we will introduce each function in the module with such a comment.
Implementing your first hook
Hooks are fundamental to Drupal modules. They allow you to integrate your module into the actions of Drupal core.
[php]<?php<br />
<div><br />
<pre>function current_posts_help($path, $arg) {</p>
<p>}<br />
?>[/php]
[php]<?php<br />
/**<br />
* Implements hook_help.<br />
*<br />
* Displays help and module information.<br />
*<br />
* @param path<br />
* Which path of the site we're using to display help<br />
* @param arg<br />
* Array that holds the current path as returned from arg() function<br />
*/<br />
function current_posts_help($path, $arg) {<br />
switch ($path) {<br />
case "admin/help#current_posts":<br />
return '<p>'. t("Displays links to nodes created on this date") .'</p>';<br />
break;<br />
}<br />
}<br />
?>[/php]
(Note the closing ?>
should not appear in your code.)
Declaring the block
To use this hook to define our block, go to your current_posts.module
file and create the function current_posts_block_info()
as follows:
/**<br />
* Implements hook_block_info().<br />
*/<br />
function current_posts_block_info() {<br />
$blocks['current_posts'] = array(<br />
'info' => t('Current posts'), //The name that will appear in the block list.<br />
'cache' => DRUPAL_CACHE_PER_ROLE, //Default<br />
);<br />
return $blocks;<br />
}<br />
?>[/php]
(Remember not to include the closing ?>
in your code.)
Retrieving data
The function begins with getting the time numbers. Here's the first part:
/**<br />
* Custom content function.<br />
*<br />
* Set beginning and end dates, retrieve posts from database<br />
* saved in that time period.<br />
*<br />
* @return<br />
* A result set of the targeted posts.<br />
*/<br />
function current_posts_contents(){<br />
//Get today's date.<br />
$today = getdate();<br />
//Calculate the date a week ago.<br />
$start_time = mktime(0, 0, 0,$today['mon'],($today['mday'] - 7), $today['year']);<br />
//Get all posts from one week ago to the present.<br />
$end_time = time();<br />
?>[/php]
Next we use Drupal's Database API to retrieve our list of current nodes. This is the second part of the custom function:
//Use Database API to retrieve current posts.<br />
$query = db_select('node', 'n')<br />
->fields('n', array('nid', 'title', 'created'))<br />
->condition('status', 1) //Published.<br />
->condition('created', array($start_time, $end_time), 'BETWEEN')<br />
->orderBy('created', 'DESC') //Most recent first.<br />
->execute();<br />
return $query;<br />
}<br />
?>[/php]
- We build the query using the
db_select
method, which takes a table name ('node') and alias ('n') as arguments. - The
fields
method uses the table assigned the alias 'n' to select the fields listed in the array in the second argument. - The
condition
method takes three arguments. The first is the field, the second the value, the third the operator. If no operator is specified, as in 'status' above,=
is assumed. - The
orderBy
method sorts according to the field in the first argument, in the order specified by the second argument. - The
execute
method compiles and runs the query and returns a result set/statement object.
Here's the complete function:
/**<br />
* Custom content function.<br />
*<br />
* Set beginning and end dates, retrieve posts from database<br />
* saved in that time period.<br />
*<br />
* @return<br />
* A result set of the targeted posts.<br />
*/<br />
function current_posts_contents(){<br />
//Get today's date.<br />
$today = getdate();<br />
//Calculate the date a week ago.<br />
$start_time = mktime(0, 0, 0,$today['mon'],($today['mday'] - 7), $today['year']);<br />
//Get all posts from one week ago to the present.<br />
$end_time = time();</p>
<p>//Use Database API to retrieve current posts.<br />
$query = db_select('node', 'n')<br />
->fields('n', array('nid', 'title', 'created'))<br />
->condition('status', 1) //Published.<br />
->condition('created', array($start_time, $end_time), 'BETWEEN')<br />
->orderBy('created', 'DESC') //Most recent first.<br />
->execute();<br />
return $query;<br />
}<br />
?>[/php]
(Remember not to include the closing ?>
in your code.)
Generating block content
Access check
Here's the first part of the code:
function current_posts_block_view($delta = '') {<br />
switch($delta){<br />
case 'current_posts':<br />
$block['subject'] = t('Current posts');<br />
if(user_access('access content')){<br />
//Retrieve and process data here.<br />
}<br />
?>[/php]
Coding the data as links
Here's the next bit of code:
//Use our custom function to retrieve data.<br />
$result = current_posts_contents();<br />
//Array to contain items for the block to render.<br />
$items = array();<br />
//Iterate over the resultset and format as links.<br />
foreach ($result as $node){<br />
$items[] = array(<br />
'data' => l($node->title, 'node/' . $node->nid),<br />
);<br />
}<br />
?>[/php]
Theming the data
Here's the last section of code for current_posts_block_view
:
<p>if (empty($items)) { //No content in the last week.<br />
$block['content'] = t('No posts available.');<br />
} else {<br />
//Pass data through theme function.<br />
$block['content'] = theme('item_list', array(<br />
'items' => $items));<br />
}<br />
}<br />
}<br />
return $block;<br />
}<br />
?>[/php]
The Final Steps
Testing and troubleshooting the module
It's time to enable and fully test your module!
Enable the module
Go to Modules, or http://example.com/admin/modules
, and scroll down to the bottom of the list in the 'Other' category. You should see the module 'Current posts.' Click the checkbox to enable Current posts, and save your configuration. Now you should see a link to Help beside the module name. Click it to see the help text you entered in current_posts_help
.
Enable the block
Next, navigate to Structure > Blocks, or http://example.com/admin/structure/block
. Scroll down to the bottom of the list. Among the disabled blocks, you should find the name, 'Current posts'. Set its location for one of the page regions and save. Navigate to another page like your homepage to see your block. Congratulations! You have written a working module.
Troubleshooting
If you get a "white screen" or a PHP error when you enable this module, it probably means you have a syntax error in your .module
file. Be sure all your punctuation is correct, semi-colons, commas, etc. all in the right places, and that you have all the hook names and module short names spelled correctly. (In the case of a white screen, you may be able to find out what the PHP error was by looking in your Apache error log. Or you can try changing PHP's error reporting level.)
If you cannot find and fix the syntax error, nothing on your site will display, because Drupal will try to load your module on every page request. The easiest way to get your site working again is to delete the module's folder or move it out of the site, in which case Drupal will figure out that it shouldn't load this module after all, and your site should work again.
Clear caches
Drupal caches a lot of data, and if you are not seeing changes appear, that could be why. In this phase of the module, the caches shouldn't be an issue, but they will be as we proceed. To get all the troubleshooting instructions in one place, we'll give you the instructions here that you'll need later.
To clear the caches, go to Configuration > Performance or http://example.com/admin/config/development/performance
, and click the Clear all cachesbutton.
May 23, 2012
Working of Drupal theme system
In the below section I've tried to define the theme structure of Drupal 7.x. Always remember "Never hack core!"
Why you shouldn't modify core files
No matter how easy it is to modify core files to make Drupal do what you want it to do, resist the temptation.
- Doing so will make it complicated,difficult or near impossible to apply site updates such as Security and bug fixes.
- You will make it difficult for those that come after to maintain the site.
- You could possibly leave your site vulnerable to exploits.
The Drupal core has been designed to be modular, so there should be no reason to hack it. If there is a feature you want and it cannot be accomplished outside of modifying core, consider submitting your hack as a patch. Create an issue and tell the community the feature you want to accomplish. It will then be tested and your feature may become a part of the Drupal core.
Exceptions
Are there exceptions to this rule?
Nope.
Okay, maybe. But this is generally for specific sites or implementations by people who are extremely familiar with the Drupal code base, development practices and security model. Those who properly document their changes and practice proper revision control with their code. If you have to ask, chances are you shouldn't.
Overview of theme files
A theme is a collection of files that define the presentation layer. You can also create one or more "sub-themes" or variations on a theme. Only the .info file is required, but most themes and sub-themes will use other files as well. The following diagram illustrates the files that are found in a typical theme and sub-theme.
.info (required)
All that is required for Drupal to see your theme is a ".info" file. Should the theme require them, meta data, style sheets, JavaScripts, block regions and more can be defined here. Everything else is optional.
The internal name of the theme is also derived from this file. For example, if it is named "drop.info", then Drupal will see the name of the theme as "drop". Drupal 5 and below used the name of the enclosing folder of the theme.
Info files for themes are new in Drupal 6. In version 5, .info files were used solely for modules.
template files (.tpl.php)
These templates are used for the (x)HTML markup and PHP variables. In some situations they may output other types of data --xml rss for example. Each .tpl.php file handles the output of a specific themable chunk of data, and in some situations it can handle multiple .tpl.php files through suggestions. They are optional, and if none exists in your theme it will fall back to the default output. Refrain from having complex logic in these files. In most cases, it should be straight (x)HTML tags and PHP variables. A handful of these templates exist in directories where core and contributed modules exist. Copying them to your theme folder will force Drupal to read your version.
Note: The theme registry caches information about the available theming data. You must reset it when adding or removing template files or theme functions from your theme.
template.php
For all the conditional logic and data processing of the output, there is the template.php file. It is not required, but to keep the .tpl.php files tidy it can be used to holdpreprocessors for generating variables before they are merged with the markup inside .tpl.php files. Custom functions, overriding theme functions or any other customization of the raw output should also be done here. This file must start with a PHP opening tag "<?php", but the close tag is not needed and it is recommended that you omit it.
Sub-themes
On the surface, sub-themes behave just like any other theme. The only differences is that they inherit the resources from their parent themes. To create one, a "base theme" entry inside the .info file is needed. From there it will inherit the resources from its parent theme. There can be multiple levels of inheritance; i.e., a sub-theme can declare another sub-theme as its base. There are no hard set limits to this.
Drupal 5 and below required sub-themes to be in sub-directories of the parent theme. This is no longer the case.
Others
- The logo and screen shot are not absolutely necessary for the theme to function, but they are recommended, especially if you are contributing your theme to the Drupal repository. Screenshots will show inside the theme administration page and the user account settings for selecting themes when the appropriate permissions are set. See the screenshot guidelines for more information.
- To supply administrative UI settings or "features" beyond logo, search, mission, etc., a "theme-settings.php" file can be used. This is an advanced feature. More information can be found in the Advanced settings handbook page.
- For color module support, a "color" directory with a "color.inc" file is needed along with various support files.
Remember
- If you want to base your work on a core theme, use sub-theming or make a copy and rename the theme. Directly modifying Bartik, Garland or Minnelli is strongly discouraged, since they are used for the install and upgrade process.
- All non-Core or modifications to Core themes should be installed under the "sites/all/themes" directory to keep them separate from core files. If you plan to run multiple sites from a single Drupal code base, you can make a theme available to a specific site rather than all sites; read about how to set this up in Multi-site installations.
May 16, 2012
20+ most installed modules of Drupal
Below I've listed some of the most used/installed & essential Drupal modules:
Views
What is Views
The Views module provides a flexible method for Drupal site designers to control how lists and tables of content, users, taxonomy terms and other data are presented.
This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. It has four modes, plus a special mode, and provides an impressive amount of functionality from these modes.
Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.
Token
Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user]. The Token module provides a central API for modules to use these tokens, and expose their own token values.
Note that Token module doesn't provide any visible functions to the user on its own, it just provides token handling services for other modules.
Pathauto
The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. This allows you to have URL aliases like /category/my-node-title instead of/node/123. The aliases are based upon a "pattern" system that uses tokens which the administrator can change.
Chaos tool suite (ctools)
This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.For the moment, it includes the following tools:
- Plugins -- tools to make it easy for modules to let other modules implement plugins from .inc files.
- Exportables -- tools to make it easier for modules to have objects that live in database or live in code, such as 'default views'.
- AJAX responder -- tools to make it easier for the server to handle AJAX requests and tell the client what to do with them.
- Form tools -- tools to make it easier for forms to deal with AJAX.
- Object caching -- tool to make it easier to edit an object across multiple page requests and cache the editing work.
- Contexts -- the notion of wrapping objects in a unified wrapper and providing an API to create and accept these contexts as input.
- Modal dialog -- tool to make it simple to put a form in a modal dialog.
- Dependent -- a simple form widget to make form items appear and disappear based upon the selections in another item.
- Content -- pluggable content types used as panes in Panels and other modules like Dashboard.
Content Construction Kit (CCK)
The Content Construction Kit allows you to add custom fields to nodes using a web browser.
Administration menu
Provides a theme-independent administration interface (aka. navigation, back-end). It's a helper for novice users coming from other CMS, a time-saver for site administrators, and useful for developers and site builders.
Administrative links are displayed in a CSS/JS-based menu at the top on all pages of your site. It not only contains regular menu items — tasks and actions are also included, enabling fast access to any administrative resource your Drupal site provides.
Wysiwyg
Allows to use client-side editors to edit content. It simplifies the installation and integration of the editor of your choice. This module replaces all other editor integration modules. No other Drupal module is required.
Wysiwyg module is capable to support any kind of client-side editor. It can be a HTML-editor (a.k.a. WYSIWYG), a pseudo-editor (buttons to insert markup into a textarea), or even Flash-based applications. The editor library needs to be downloaded separately. Various editors are supported (see below).
Wysiwyg module also provides an abstraction layer for other Drupal modules to integrate with any editor. This means that other Drupal modules can expose content-editing functionality, regardless of which editor you have installed.
Date
This package contains both a flexible date/time field type Date field and a Date API that other modules can use.
IMCE
IMCE is an image/file uploader and browser that supports personal directories and quota.
Google Analytics
Adds the Google Analytics web statistics tracking system to your website.
The module allows you to add the following statistics features to your site:
- Single/multi/cross domain tracking
- Selectively track/exclude certain users, roles and pages
- Monitor what type of links are tracked (downloads, outgoing and mailto)
- Monitor what files are downloaded from your pages
- Custom variables support with tokens
- Custom code snippets
- Site Search support
- AdSense support
- Tracking of Goals
- Anonymize visitors IP address
- Cache the Google Analytics code on your local server for improved page loading times
- Access denied (403) and Page not found (404) tracking
- DoNotTrack support (non-cached content only)
Webform
Webform is the module for making surveys in Drupal. After a submission, users may be sent an e-mail "receipt" as well as sending a notification to administrators. Results can be exported into Excel or other spreadsheet applications. Webform also provides some basic statistical review and has and extensive API for expanding its features.
ImageAPI
This API is meant to be used in place of the API provided by image.inc. You probably do not need to install this module unless another module are you using requires it. It provides no new features to your Drupal site. It only provides an API other modules can leverage. Currently GD2 and ImageMagick support are distributed with ImageAPI.
Note: Requires PHP5!
Backup and Migrate
Backup and Migrate simplifies the task of backing up and restoring your Drupal database or copying your database from one Drupal site to another. It supports gzip, bzip and zip compression as well as automatic scheduled backups.
With Backup and Migrate you can dump some or all of your database tables to a file download or save to a file on the server, and to restore from an uploaded or previously saved database dump. You can chose which tables and what data to backup and cache data is excluded by default.
Link
The link module can be count to the top 50 modules in Drupal installations and provides a standard custom content field for links. With this module links can be added easily to any content types and profiles and include advanced validating and different ways of storing internal or external links and URLs. It also supports additional link text title, site wide tokens for titles and title attributes, target attributes, css class attribution, static repeating values, input conversion, and many more.
Advanced help
The advanced help module allows module developers to store their help outside the module system, in pure .html files. The files can be easily translated simply by copying them into the right translations directory. The entire system can appear in a popup or not as the module prefers (and by taking away access to view the popups, a site can force the popups to not exist).
The system ties into Drupal's search system and is fully indexed, so the entire contents can be searched for keywords. the help files can be placed in a hierarchy as well, allowing for top down navigation of the help.
By itself, this module doesn't do much; it requires another module to support it, but it does come with a nice little sample of text from Wikipedia to demonstrate the system.
Accessing Advanced_help
When this module is installed, users with the view advanced help index permission can access the advanced help index by going to
Administer -> Advanced Help
(http://www.example.com/admin/advanced_help). Additional view advanced help popup and view advanced help topic permissions enable them to access the actual help pages and popups.Libraries API
The common denominator for all Drupal modules/profiles/themes that integrate with external libraries.
This module introduces a common repository for libraries in sites/all/libraries resp. sites/<domain>/libraries for contributed modules.
- External libraries
- Denotes libraries ("plugins") that are neither shipped nor packaged with a project on drupal.org. We do not want to host third-party libraries on drupal.org for a multitude of reasons, starting with licensing, proceeding to different release cycles, and not necessarily ending with fatal errors due to conflicts of having the same library installed in multiple versions.
CAPTCHA
A CAPTCHA is a challenge-response test most often placed within web forms to determine whether the user is human. The purpose of CAPTCHA is to block form submissions by spambots, which are automated scripts that post spam content everywhere they can. The CAPTCHA module provides this feature to virtually any user facing web form on a Drupal site.
XML sitemap
The XML sitemap module creates a sitemap that conforms to the sitemaps.org specification. This helps search engines to more intelligently crawl a website and keep their results up to date. The sitemap created by the module can be automatically submitted to Ask, Google, Bing (formerly Windows Live Search), and Yahoo! search engines. The module also comes with several submodules that can add sitemap links for content, menu items, taxonomy terms, and user profiles.
CKEditor - WYSIWYG HTML editor
CKEditor is the next version of FCKeditor. The editor has been rebranded and completely rewritten. It is now much faster (the code has been optimized), loads faster (the number of files has been reduced, so the browser will perform less HTTP requests) and developers friendly.
jQuery UI
A wrapper module around the jQuery UI effects library that lets module developers add swooshy, swishy effects to their code.
jQuery Update
Upgrades the version of jQuery in Drupal core to a newer version of jQuery.
Panels
The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.
Poormanscron
A module which runs the Drupal cron operation using normal browser/page requests instead of having to set up a crontab to request the cron.php script. The module inserts a small amount of JavaScript on each page of your site that when a certain amount of time has passed since the last cron run, calls an AJAX request to run the cron tasks. Your users should not notice any kind of delay or disruption when viewing your site. However, this approach requires that your site gets regular traffic/visitors in order to trigger the cron request.
Lightbox2
The Lightbox2 module is a simple, unobtrusive script used to overlay images on the current page. It's a snap to setup and works on most modern browsers.
Views Slideshow
Views Slideshow can be used to create a slideshow of any content (not just images) that can appear in a View. Powered by jQuery, it is heavily customizable: you may choose slideshow settings for each View you create.
Potential uses
- News item slideshow (such as the title, image and teaser of the last 5 news articles submitted)
- The Last X number of X submitted (images, videos, blog entries, forum posts, comments, testimonials, etc.).
- Rotate any image, based on any filters you can apply in views.
- Hottest new products for any ecommerce drupal site.
- Rotate contact links, share links, etc.
- Heck, you could rotate entire nodes, categories, image galleries, etc. I wouldn't suggest it, but you have that power.
- Its also a great space saver. Places where you had multiple images or multiple items such as RSS feeds or category listings can now be presented in a slideshow.
The possibilities are really endless, as the more ways you can think of to categorize and add to views, the more you can rotate.
Dec 9, 2011
How to get your drupal questions answered in an IRC Channel
Would you like your drupal questions answered by community experts? Then read this post - it'll tell you the best way to get answers.
Firstly, if you really want good answers, learn how to ask good questions. I thought I knew how to ask good tech-related questions until I read this: http://bit.ly/s7o0mw Then I realised that I did know how to ask good questions, and now I knew how to ask much better questions. That's helped me on irc and on support forums. You basically want to ask your question like this:
"I'm trying to achieve [A]. I thought the best way to do this was to [B]. I read the documentation and it said to do [X]. I did it, I expected to see [Y] but actually saw [Z]. What am I doing wrong?"
Out there some drupal genius (like me! lol) reads this question. And immediately knows a few things:
The outcome that you're trying to achieve. Knowing this, we may have a better suggestion instead of [B] and thereby solve your problem.
You're already thinking - because of [B]. Whohoo! We know that you're someone who is thinking how to do something which will achieve your outcome. Tech geniuses would rather answer questions from people who are willing to do their own thinking.
You read documentation - double points. It means you're not asking someone else to do all the hard work. Plus you're learning new stuff. Both good pointers, and you're more likely to get helped.
When you did [X] you've told us what you expected to see when you tried [X]. That means you're thinking. Then you say that instead of [Y] you saw something else - [Z]. Awesome - that's valuable information.
Questions like, "Help, my website is broken!" or "Views isn't working" or "Taxonomy isn't linking properly" will get you ignored almost 100% of the time.
Read the documentation. Yes, RTFM applies - always. There's a reason documentation is written - and if it's out of date, update it yourself!
Maybe someone else has already asked your question. Search drupal.org via google (go to google.com and type "site:drupal.org terms related to your problem"). If nothing shows up, search the internet. If nothing shows up, time to ask your question!
Ask your question in the right channels, those would be the forums on drupal.org or the issue queue for the module you're having a problem with.
Or simply figure out how to join #drupal on IRC (for that you can use http://webchat.freenode.net its simple and easy too use and compatible with any browser, since I'm using it ;) ), you can also choose your preferable channel from here http://drupal.org/irc or http://drupal.org/node/679904.
Remember the BOT named 'Drupalicon' is there for you, if you wanna learn how to interrogate with 'Drupalicon' on IRC read this http://drupal.org/project/bot, if in case you're finding it difficult just type a message in the Drupal channel 'bot?' (without quotes) there will be a reply 'I'M UP! I'M UP!'.
Please don't ask your question in http://groups.drupal.org/india because this is for location-specific activities, and there may be other people on drupal.org who'd also like to know the answer to your question (plus, your question on the drupal forums is searchable, so in a month someone else may have the same problem you're having and also wants to know the solution - be kind and place your question somewhere they can find it!).
If you're going to post a question in the issue queue, first read the Troubleshooting FAQ. If you're having a problem with your Drupal site, you're almost certainly not alone. Your questions may already have been asked and answered many times. Save yourself some time and start with this list of Frequently Asked Questions (FAQs) before you post an issue in the queue.
Don't be a support leech. Play nicely! And learn how to be part of a community, particularly a self-organising one.
Lastly, read this post and follow all of this advice! It will transform you into the kind of person whom other people enjoy helping, and take you one step closer to being Certified to Rock! And if someone does something which violates any of these guidelines, gently point them to this post.
Dec 7, 2011
Is Drupal 7 slow?
There are some performance issues with Drupal 7 currently on some server/server configurations.
As a start, you could try the 7.x-dev snapshot to see if there are any improvements.
- Is your server is a shared hosting or your own server or local development environment?
- Did you already use Drupal 6 in the same environment?
- Did you enable the basic performance settings, like aggregating CSS/JS?
- To do anything more, you will actually need to figure out what exactly is slow, there is often a specific bottleneck that is slowing down the whole site. As a start, you could enable devel.module and the query logging to see if there are any slow queries on that page.
- If this is your own server, I strongly suggest to install and enable APC.
Most probably, you are hitting Avoid re-scanning module directory when multiple modules are missing. It happens if you have some missing modules in your installation.
Try to check your system table:
[php]SELECT name, filename FROM system WHERE type = 'module' AND status = 1 ORDER BY filename[/php]And clean-up any modules that are still enabled but missing from the filesystem.
Overall, Drupal 7 is way more resource friendly and scalable then Drupal 6, other then some unfortunate regressions like this one.
Drupal 7 is optimized out of the box for large website featuring advanced cache features, reverse proxy, load balancer. You would say that this would make drupal 6 too fly, but there is noticable difference between drupal 6 and drupal 7 performace with same high end server setup.
Drupal 7 may let you down initially, but given the proper hardware and software environment, you can do wonders with drupal in terms of speed.
Drupal 7 uses too many files and like D6, it uses also too many SQL queries (in comparison with other CMS). So the first hit could take time, especially when you have a slow disk and files are not in OS cache.
In a normal situation, when cache is available, everything should be ok. There are many layer of cache: OS cache to avoid reading PHP files, opcode cache (like APC, not enabled by default) to avoid re-parsing PHP files, MySQL cache to avoid re-execute queries multiple times.
Morally, most of the time its not drupal, its probably the server at fault. Its true over the time drupal has evolved to be a resource hungry. But its only till you precise it that way. The fact is that drupal 7 is infact very resource friendly, since when it is used on a VPS with MemCache, APC installed then it flew like anything.
Dec 4, 2011
Simple JQuery Toggle Tutorial | CSS JQuery Slide Toggle
Today I am going to share a very common and easy jquery tutorial with you. A JQuery Slide Toggle function.
.slideToggle() function is used to hide or show matched elements in a sliding effect.
So the basic syntax is
[js]$("div").slideToggle("slow");[/js]So this was the basic syntax on how to slide toggle a div, now lets start with some real working examples.
So first the basic html code:
[html]
<div id="toggle">
<ul>
<li>Youtube Video Scraping</li>
<div>
Always I wondered to display youtube videos below my posts or for some other purpose. But always had to use some plugins or some complicated scripts. So finally coded for you people a small function which will fetch or scrape...<a href="http://webstutorial.com/youtube-video-scraping-fetch-youtube-video-through-rss/programming/php">Continue reading</a>
</div>
<li>WordPress Multiple Category Search</li>
<div>
Since when I started wordpress, I had a question in my mind, why wordpress doesn’t give multiple search option? I googled a lot, but couldn’t find a plugin or code which exactly works. So finally decided to go more into...<a href="http://webstutorial.com/wordpress-multiple-category-search/content-management-system-cms/wordpress-cms">Continue reading</a>
</div>
<li>Youtube Video Scraping</li>
<div>
Always I wondered to display youtube videos below my posts or for some other purpose. But always had to use some plugins or some complicated scripts. So finally coded for you people a small function which will fetch or scrape...<a href="http://webstutorial.com/youtube-video-scraping-fetch-youtube-video-through-rss/programming/php">Continue reading</a>
</div>
<li>Ten WordPress Useful Functions And Snippets</li>
<div>
Some useful WordPress PHP funtions. Just copy and paste these functions in your themes functions.php file Change the WP Login Logo & URL Link Load JQuery From Google CDN How to remove the WordPress Version Information Remove Default WordPress Meta...<a href="http://webstutorial.com/ten-wordpress-useful-functions/content-management-system-cms/wordpress-cms">Continue reading</a>
</div>
<li>A Good PHP Developer Can Answer This | PHP Test</li>
<div>
PHP developers go through 3 stages in their life Beginner Good Best A beginner PHP coder is some one who just started making some PHP projects in CMS like WordPress, Joomla, Magento and other PHP based CMS. A good PHP... <a href="http://webstutorial.com/good-php-developer-answer-php-test/programming/php">Continue reading</a>
</div>
</ul>
</div>
[/html]
And finally our js
[js]
<script type="text/javascript">
$(document).ready(function() {
$("li").click(function(){
$(this).toggleClass("active");
$(this).next("div").stop('true','true').slideToggle("slow");
});
});
</script>
[/js]
Explanation:
In our basic html layout, we have placed a div exactly next to our li. So we tell the jquery to slide exactly the next div of the current clicked li. If we directly write slideToggle then it will slide all the div's of the current page. In the above js code, we are also using a stop() function. This is essential to use, to avoid multiple clicks on a same li making it to slide for continuous multiple times of sliding.
Here's a working demo of the above code
Oct 29, 2011
A Good PHP Developer Can Answer This | PHP Test
- Beginner
- Good
- Best
A beginner PHP coder is some one who just started making some PHP projects in CMS like Wordpress, Joomla, Magento and other PHP based CMS.
A good PHP coder completed or knows all PHP based CMS and is about to finish PHP Frameworks like Yii, Cake, Symphony, CI and others.
A best PHP coder is a complete package of Beginner and Good, that person needs no questions cause he might be ready with all the answers.
Now its time to rate yourself in PHP, I googled and found some questions which only a Good coder can answer.
Q1: What is
T_PAAMAYIM_NEKUDOTAYIM
?A: Its the scope resolution operator (double colon ::). This is valid for PHP 4 and later only.
Q2: What is the cause of this warning: 'Warning: Cannot modify header information - headers already sent', and what is a good practice to prevent it?
A: Reason: body data was sent, causing headers to be sent too. This normally occurs when white space is sent accidentally.
Q3: What's wrong in this query:
"SELECT * FROM table WHERE id = $_POST[ 'id' ]"
?A: This is the worst practice to select some row or fetch data, use specific row instead of *. Use PDO prepared statements to avoid SQL Injections.
Q4: What is wrong with this if statement:
if( !strpos( $thread, $needle ) ...
?A:
strpos
returns the index position of needle, it could return false if its at 0 position. Instead give a if else check if( false !== strpos( $thread, $needle )...
Q5: What is the preferred way to write this if statement, and why?
if( 5 == $someVar )
or if( $someVar == 5 )
A: The former, it prevents accidental assignments of 5 to $somevar if you forgot two == signs(
if( $someVar = 5 )
)Q6: In the below code, whats the value of
$a
and $b
after the function call and why?[php]
function doSomething( &$arg )
{
$return = $arg;
$arg += 1;
return $return;
}
$a = 3;
$b = doSomething( $a );
[/php]
A:
$a
is 4
and $b
is 3
. The former because $arg is passed by reference, the latter because the return value of the function is a copy of (not a reference to) the initial value of the argument.Q7: What is the difference between
public
, protected
and private
in a class definition?A:
public
makes a class member available to "everyone", protected
makes the class member available to only itself and derived classes, private
makes the class member only available to the class itself.Q8: What is wrong with this code:
[php]
class SomeClass
{
protected $_someMember;
public function __construct()
{
$this->_someMember = 1;
}
public static function getSomethingStatic()
{
return $this->_someMember * 5; // here's the catch
}
}
[/php]
A: Static methods don't have access to $this, because static methods can be executed without instantiating a class.
Q9: What is the difference between an interface and an abstract class?
A: An interface defines a contract between an implementing class is and an object that calls the interface. An abstract class pre-defines certain behaviour for classes that will extend it. To a certain degree this can also be considered a contract, since it garantuees certain methods to exist.
Q10: Which one is correct?:
$array[name]
or $array['name']
?A: Both of them will output the value, but only the quoted form is correct. To check this
define(name,0);
and see the bugs flying in the website.Now how much did you score out of 10, comment your score below, and if you have any more questions then let me know after all sharing is caring ;)
Oct 25, 2011
How to use Views Slideshow in Drupal 7
1. Required Modules (Version: Drupal 7.8)
- Views (7.x-3.0-rc1)
- Views Slideshow (7.x-3.x-dev)
- Chaos tool suite (7.x-1.0-rc1)
- Libraries (7.x-1.0)
- Link (7.x-1.0)
- Token (7.x-1.0-beta6)
2. Install the Modules
In Drupal 7 you can install modules from the admin section, but I still feel this new feature doesn't have any meaning, because we have to search for the module link in the Drupal site and then copy paste into the admin module installation area, it would have been so good if they would have made it something like WordPress a small search feature. Anyway I just gonna download and install it in the old way (I still recommend this old way).
Download all the above listed modules from http://drupal.org/project and install in the directory examplesite.com/sites/all/modules
Go to http://www.examplesite.com/admin/modules and enable these modules as below:
- Views
- Views UI
- Views Slideshow
- Views Slideshow: Cycle
- Chaos tools
- Libraries
- Link
- Token
3. Create Image Cache
In Drupal 7 imagecache is part of core module and is named as Image styles. So let's create two image cache from here, one for the full size slider image and other for the thumbnail image. In this tutorial I use 640x480 (pixels) dimension for the full size slider image and 320x240 (pixels) dimension for the thumbnail image. Note: These configurations can be defered depends on your needs.
Fullsize Slider image settings
Go to http://www.examplesite.com/admin/config/media/image-styles and click on the add new style link
- Give an Image style name and click on create new style button.
- On the next configuration screen select new style you want and then click add button (In this tutorial I choose re-size style).
- On the next screen set the width and height and click on the add effect button. (The settings may vary depend on the style you choose). I set width as 640 and height as 480 pixels.
- Do this same process for the thumbnail image too. (for the thumbnail image dimension, I set width as 320 and height as 240 pixels.)
4. Create New Content Type
Let's create a new content type, from the dashboard menu bar cick on Structure and then Content types then click on the add new content type link.
- Give a human-readable name, I named it as Featured Slider (machine name will be auto generated based on the human readable name)
- Give a brief and relevant description
- Submission form settings, I leave as the default settings
- Publishing options, I checked only published (all other settings unchecked)
- Display settings, I have unchecked the authour and date info.
- Comment settings, I set hidden (disabled)
- Menu settings, I leave as default settings.
- Click Save and add fields Button
5. Create New Fields
Here in this example I'll create only two fileds, and they are image field and link field. We will use image field for uploading our slider image and link field for creating a custom link where we want our slider to be linked.
- Image Field Settings
- Label: Slider Image
- Field: slider_image
- Field type: image
- Widget (form element): image
- Click Save button, and on the field settings page leave default settings and click on Save field settings button.
- On the image field configuration settings page you can configure as you wish.
- I set this field as required, I added a file director name called slider-image so that this images will be arranged separately from other images.
- You can set the maximum upload size and resolution here, I have enabled alt and title field and finally click Save settings button.
By using same method create the link field too.
Link Field Settings:
- Label: Slider Link
- Field: slider_link
- Field type: link
- Widget (form element): link
- Click "Save" button
Note: For the link field configurations leave everything to default settings.
I have re arranged the field like shown below:
- Title field
- Image field
- Link field
- Body field (you can even remove this field if not necessary)
Manage Display
On the manage display tab you can conigure how the out put of the field to be diplayed, I have set the image label as hidden.
6. Create Feature Slider Content
I have created four featured slider content for this tutorial.
- Click on add content link
- Create Featured Slider content
- Give a proper title name
- Upload slider image
- Give alt and title field names
- Give a link title and url where you want the slider to be linked
- Leave all othe settings as default except for the path field if you want you can give an SEO friendly URL alias.
- Save the content.
Repeat the steps twice or thrice to create some more featured slider contents for your slide (I have created four contents)
7. Create a New View
Now it's time to create our new Slideshow view. From the Dashboard menu click on the Structure and then click on the Views.
- Click add new view link
- Give view name, I have named as Featured Slider (machiine name will be auto generated)
- Give an apropriate view description
- Choose Show Content of type Featured Slider (your content type name).
- Uncheck Create a Pge and check Create a block
- Type in Block title and choose display format as "Slideshow" of "fields" items per page 5 (you can enter the number of items you want to display)
- Click the button "Continue & edit"
Views Field Settings
- Add "Link" Field
- "Link" must be the first field in order to work everything properly, so click on the add icon and from the filter Groups select "Content"
- Add Content: "Link" "Appears in: node:featured_slider."
- Click: "Add & configure button"
- In the next cofiguration window uncheck "Create a label" and check "Exclude from display"
- Click "Apply button".
- Add "Image" Field
- Click on the add icon and from the filter Groups select "Content"
- Add Content: "Image" "Appears in: node:featured_slider." (Note: Make sure you choose the "Image" field which we created for this slider content type only.)
- Click "Add & configure button"
- In the next cofiguration window uncheck "Create a label"
- Formatter: "Image" (If you have installed "Colorbox" or "Lightbox2" you can choose them here.)
- Image Style: "Fullsize" (Choose the imagecache you have created in the above step "3. Create Image Cache")
- Link image to: "Nothing"
- Style Settings: "Leave default settings"
- No result behaviour: "Leave default settings"
- Rewrite Results: Check "Output this field as a link"
- Link path: [view_node] (Note: Scroll dow a bit and you can see replacement patterns created by Token module, (If we didn't set the link field as first we can't see link field option here) copy only [view_node] then scroll up and paste it in the link path field.)
- Click "Apply button".
- Add "Thumbnail" Field
- Click on the add icon and from the filter Groups select "Content"
- Add Content: "Image" "Appears in: node:featured_slider." (Note: Make sure you choose the "Image" field which we created for this slider content type only.)
- Click "Add & configure button"
- In the next cofiguration window uncheck "Create a label" and check "Exclude from display"
- Formatter: "Image" (If you have installed "Colorbox" or "Lightbox2" you can choose them here.)
- Image Style: "Thumbnail" (Choose the imagecache you have created in the above step "3. Create Image Cache")
- Link image to: "Nothing"
- Style Settings: "Leave default settings"
- No result behaviour: "Leave default settings"
- Rewrite Results: Check "Output this field as a link"
- Link path: [view_node] (Note: Scroll dow a bit and you can see replacement patterns created by Token module, (If we didn't set the link field as first we can't see link field option here) copy only [view_node] then scroll up and paste it in the link path field.)
- Click "Apply button".
Views Filters Settings
In Views 3.x the filters are created in the beginning while we choose the content type and other settings. If you need any additional filtering you can create it here.
Views Style Settings
Click on the "Format Slideshow Settings" and on the next configuration window set as below:
- List type: "Unordered list"
- Wrapper class: "Leave default settings"
- Style » Skin: "Deafult"
- Slides » Slideshow type: "Cycle"
"Cycle Options"
You need to download jQuery cycle plugin and copy jquery.cycle.all.min.js to sites/all/libraries/jquery.cycle You can find the plugin at http://malsup.com/jquery/cycle.
In a Simpler Manner
Create a folder named "libraries" in your "examplesite.com/sites/all/" directory and then create an another folder named "jquery.cycle" in that directory and finally copy and paste only the "jquery.cycle.all.min.js" into this directory. For e.g. examplesite.com/sites/all/libraries/jquery.cycle/jquery.cycle.all.min.js
- Transittion: "Fade"
- Action: "Pause on Hover"
- Internet Explorer Tweaks: "Default"
- Widgets: You can choose either or both Top and Bottom (I choose bottom here, and the advance settings as below:)
- Bottom Widgets » Pager » Pager type: "Fields"
- Pager field » Content: "Image" (Note: Last one we added for the thumb, don't mistake since both field will be named same.)
- Activate Slide and Pause on Pager Hove: Checked » "Controls" and Unchecked » "Slider Counter"
- Click on "Apply button".
Format Show Field Settings
- Inline fields: "Choose the thumbnail field as inline."
- Click on "Apply button." (Note: Well it actually doesn't change much in appearance but it does change in the code.)
8. Enable & Configure the Block
Now this block will be visible in the blocks disabled area, so from the Dashboard menu go to Structure » Block and "Enable" the block to a themes default region or any of the custom region you've created. (Regions varies depends on the theme you are using.)
Block Configuration Settings
After enabling the block you get a link to configure the block so click on the "Configure" link and on the settings section set as below;
- Block title (If you don't want block title to be displayed just type <none>)
- Again you get all enabled theme specific Region settings.
On Visibility Setings
- Pages » Show block on specific page: choose Only the listed pages and typeso that this block will be displayed only on the front page.
Oct 7, 2011
Must have modules for creating a site in Drupal 7.x
Ctools
This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.
Custom Breadcrumbs
Allows administrators to set up parametrized breadcrumb trails for any node type. This allows CCK-style node types to have "Home > User Blog > 2005 > January" style breadcrumbs on the node view page itself, synchronizing cleanly with custom views or pathauto aliases. Breadcrumb visibility can be customized via a php snippet.
No new features are planned for these versions, but they are still supported and bug reports are encouraged.
Fivestar
The Fivestar voting module adds a clean, attractive voting widget to nodes in Drupal 5, node and comments in Drupal 6, and any entity in Drupal 7
Panels
The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.
Pathauto
The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a "pattern" system which the administrator can control.
Porter-Stemmer
This module implements the Porter stemming algorithm to improve English-language searching with the Drupal built-in Search module.
The process of stemming reduces each word in the search index to its basic root or stem (e.g. 'blogging' to 'blog') so that variations on a word ('blogs', 'blogger', 'blogging', 'blog') are considered equivalent when searching. This generally results in more relevant search results.
Rules
The rules modules allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules).
Token
Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user]. The Token module provides a central API for modules to use these tokens, and expose their own token values.
Views
The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of this, particularly in how taxonomy and tracker lists are formatted.
This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. It has four modes, plus a special mode, and provides an impressive amount of functionality from these modes.
Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.
Webform
Webform is the module for making surveys in Drupal. After a submission, users may be sent an e-mail "receipt" as well as sending a notification to administrators. Results can be exported into Excel or other spreadsheet applications. Webform also provides some basic statistical review and has and extensive API for expanding its features.
Aug 9, 2011
Wordpress Themes For Photographers | Best Wordpress Portfolio Themes
After a long search on google I finally found some really good and best wordpress themes for Photographers and Portfolio.
Now a days every photographer wants to make a portfolio website, but can't find any free portfolio wordpress themes, but after seeing this post your search will come to an end.
So get started and select a theme for portfolio.
WordPress The Unstandard
The Unstandard is a two-column WordPress theme featuring three widget enabled zones. The current 2.0 release is a complete re-write requiring WordPress 3.0 or better. Prior versions of the theme utilized a timthumb + custom fields setup to populate thumbnails for core pages. Thanks to the latest features offered by WordPress, assigning a thumbnail to a post is a simple two-step process. No more manual custom fields for post thumbnails.
Gallery 1.2
The original Gallery theme, released by Smashing Magazine, is a child theme of Thematic and is a great solution for anyone wanting a unique showcase or gallery website.
WPFolio – Free Portfolio WordPress Theme
Blue Bubble
BlueBubble is a Free, Clean, Simple Premium Portfolio Wordpress Theme for Designers, Photographer or any other creative minds! :-) It’s designed for easy showcasing your work and it comes with some very cool features.
Creative by Nature
A unique and flexible high-quality portfolio WordPress theme for artists, photographers and designers. The theme was designed by .css{mayo} and released especially for Smashing Magazine and its readers.
Linquist
Work-a-holic
Fotofolio WordPress Theme
Portfolio WordPress Theme
Irresistable
Sharpfolio: WordPress Portfolio Theme
Snapshot
WP Coda
Infinity
AutoFocus
Jul 15, 2011
Wordpress Twenty Eleven Theme sidebar on Pages and Posts
So today I am with one more child theme which will add sidebar on page.php i.e. pages also
So just download and install this child theme. This new child theme will enable the sidebar on page.php and also on single.php page.