Posts

Showing posts from 2012

Accessible “Read More” Links

When there are a bunch of “read more” links on a page, it is usually fairly obvious from visual cues what the “read more” refers to. However, when screen reader users encounter a bunch of “read more” links on a page, it is not always obvious which part of the page each “read more” link refers to. A simple solution is to use a bit more descriptive text than simply “read more” and use CSS to hide the additional text. In this example the following code is used.

<p><a href="#">Read more <span class="offscreen">About NC State</span></a></p> This is the CSS rule.

.offscreen { position:absolute; left:-999px; width:1px; height:1px; top:auto; } Notes:
The off-screen text needs to be included in the <a> as well, otherwise it won’t be read correctly by screen readers.You cannot use the CSS rule display:none or visibility:hidden as that will make the content invisible to screen reader users.This code is not unique to me. It i…

Autocomplete off - (Custom Module)

'Autocomplete off' Module work on these forms - user login, user profile, user_register, user_pass.

Download Module

Form Autocomplete off

function autocomplete_form_user_login_alter(&$form, &$form_state) {
$form['#attributes']['autocomplete'] = 'off';
}

Web Accessibility Evaluation Tools & Links

Clear cache URL or menu link

Create a new page, with the input filter set to a filter that can run PHP. Then use the following snippet, which was shamelessly yanked from devel.module:
<?php/*
* 2008 Jun 26
*
* The code submitted by dharmanerd in his comment probably
* works better than the original I had, so I've modified this
* to match his code.
*
* The original code for this was shamelessly yanked from
* `devel.module`; it was the function `devel_cache_clear()`.
*
*/

// only allow site administrators to visit this page:if (!user_access('administer site configuration')) {
drupal_not_found();
}
else {
drupal_clear_css_cache();
$tables = array(
'cache',
'cache_content',
'cache_filter',
'cache_menu',
'cache_page',
'cache_views',
  );
  foreach ($tables as $table) {
cache_clear_all('*', $table, TRUE);
  }
drupal_set_message('Cache cleared.');
drupal_goto();
}?> Set a URL path for this page (perhaps 'cache_clear') so that you can clear the ca…

API reference

Welcome to the Drupal 6 developer's documentation. Newcomers to Drupal development should read the conceptual information provided in the "Components of Drupal" section, and then proceed to examine one of the heavily-documented example modules below. The examples are fully-functioning Drupal modules, so you can download them from the contributions repository and alter them as you experiment. Components of DrupalModule system (Drupal hooks)Database abstraction layerMenu systemForm generationFile upload systemSearch systemNode access systemTheme systemConstantsGlobal variablesExample modulesIn-depth discussionsForm API Quickstart Guide

11 Things About Drupal 7

(1) The default administrative theme is greatly improved.
In earlier versions of Drupal, the default administrative theme was a bit homely and hard for new, non-technical users to navigate.  There were a series of contributed modules for Drupal 6 you could install to improve the situation, but it was an extra step you had to take, and additional moving parts you have to deal with when updating.  Drupal now has a slick and user friendly administrative theme as part of core.  The administrative interface now includes Ajax goodness, an overall admin toolbar, shortcuts and generally increased loading times.
(2) Improved support for WYSWYG’s. 
In Drupal 6 you could enable WYSWYG functionality by installing external modules, but they never seemed to work quite right.  Drupal 7 makes the integration of WYSWYG editors more seamless.  The end result is that they work better.
(3) Drupal 7 loads faster.
A long time complaint about Drupal is that it makes a lot of database calls, cau…

Sections - Module

This module allows you to create sections within your site. Each section has an installed template, theme or style attached to it.
Sections are shown based on:
Node specific visibility settingsRole specific visibility settingsPage specific visibility settings (regexped paths)Custom PHP visibility snippetsRead More...

Solved Drupal Interview Questions

1.How do I access the Drupal admin panel, when the login block is disabled? Answer :- This is really a common question among Drupal beginners; we need not always want the login block to be displayed in our site. Since most of these cases the login block will be turned off in the administration. In those cases, we can access the login screen simply through the following URL.
http://sitename.com/?q=user or if the clean URL is enabled
http://sitename.com/user Similarly if you can’t access the logout link and need to logout, you can do so by using the URL
http://sitename.com/?q=logout alternatively with clean URLs enabled you can try
http://sitename.com/logout

2.What is the difference between Core and Contrib? Answer:- The standard release of Drupal, known as Drupal core, contains basic features common to content management systems. These include user account registration and maintenance, menu management, RSS-feeds, page layout customization, and system administration. The Drupal core installation …

Link checker - Module

The Link checker module extracts links from your content when saved and periodically tries to detect broken hypertext links by checking the remote sites and evaluating the HTTP response codes. It shows all broken links in the reports/logs section and on the content edit page, if a link check has been failed. An author specific broken links report is also available in "My Account".
Features:Selectively scan node types and commentsSelectively scan custom blocksScans CCK text and link fields in selected nodesChecks internal and by default external linksConfigurable link check intervalsUpdates permanently moved (301) links after specified link check fail countUnpublishes nodes after specified file not found (404) fail countWeblink nodes from Links Package module are supportedWeblinks nodes from Weblinks module are supportedOutput created by input filters is supportedSupported HTML elements: a, area, audio, embed, iframe, img, object, param, source, videoSupported link prot…

Splash - Module

Display any internal path, external URL or text as a splash page before going to the actual frontpage.
Warning: 6.x-2.7 solves a caching issue but is now incompatible with Purl - I'm looking into a workaround for this.
Features since 6.x-2.xSet the splash page to be displayed every week, day, once or always.Use the condition module to further restrict when the splash page should be displayed (e.g. certain roles, PHP code).Choose to display the splash page in a new window, by using ThickBox or by redirecting to the page.Set the size of the window or ThickBox.Let the module choose from a list of splash pages, either in random or sequence mode.Enter a filtered text to be displayed as splash page, either in the site template or full screen.Force display or skip splash page by calling the frontpage with ?splash=on/off. This is necessary to running cron on sites with the splash set to display on all pages:
0 * * * * wget -O - -q -t 1 http://example.com/cron.php?splash=off Read More.....

hide/remove the formatting guidelines and the link "More information about formatting options"

Add the following to template.php in themes/YourThemeName

/*
* Override filter.module's theme_filter_tips() function to disable tips display.
*/
function YourThemeName_filter_tips($tips, $long = FALSE, $extra = '') {
  return '';
}
function YourThemeName_filter_tips_more_info () {
  return '';
}
Note :

Better Formats - Module

Better formats is a module to add more flexibility to Drupal's core input format system. Features 6.xSet the default format per role.Set the default format per content type.Control allowed formats per content type.Hide format tips.Hide more format tips link.Hide format selection for nodes, comments, and blocks seperately, forcing the default to be used.Expand the selection fieldset by default.Disable the expand/collapse of the selection fieldset.Set selection fieldset title.Set more format tips link text.Set default formats for nodes and comments separately.Sensible defaults and fail overs for ease of use.Works with CCK textareas.Works with Panels comment form.i18n module support for user defined strings.Read More....