Translate

Friday, May 25, 2012

One Week Away! Drupal Business Summit and Drupal Camp Vancouver





We're ONE WEEK away from the Drupal Business Summit and Drupal Camp events happening here in Vancouver on June 1 & 2! We here at Appnovation are excited, not only because we're gold sponsors of both events, but also because a few of our team members have been chosen to run sessions for Drupal Camp.


Check out what our guys will be talking about:


Scott Bell - Lifecycle of a Drupal Project


Afraaz Ali - The Basics of Multisiting


Adrian Jones - The Drupal User Experience


Jim MacInnes - Drupal and HTML5: Playing Well Together


Both events will be a wealth of information for technical and business people alike looking to learn more about Drupal and what it can do for them.


Register today!





Source : http://appnovation.com//one_week_away_drupal_business_summit_and_drupal_camp_vancouver

Using Contexture links in Drupal 6 & 7





One of the useful improvements in Drupal 7 is contextual links. It allows administrative users the ability to quickly perform tasks related to regions in the page. For example, when you hover your mouse over a block, links are displayed that allow you to click and go to the block configuration page without going through cumbersome Drupal administrative navigation.


In Drupal 6, this module had been recently back ported from D7.


Here are the steps to install it:


Step 1: Download contextual link module from here and place it under the modules folder. In general the folder would be sites/all/module/contextual.


Step 2: Add extra variable to following template files under current theme folder.


- node.tpl.php: $node_classes
- views-view.tpl.php: $views_classes
- block.tpl.php: $block_classes
- page.tpl.php: $page_classes


For example, the line with $node_classes inserted in node.tpl.php should read as:



class="<?php print $classes; ?> <?php print $node_classes;?>"

Step 3: Enable the module and assign 'access contextual links' permission to users.


After that, the contextual links module should be working well for privileged users.


In Drupal 6, contextual links module comes with some default links. You can also add your own task links to the contexture dropdown by implementing hook_contextual_block, hook_contextual_node, hook_contextual_view to make better user experiences.


Here is an example that simply adding ‘Add New Page' to contextual dropdown in particular block.




/**
* Implement of hook_contextual_block
*/

function MODULE_NAME_contextual_block($block) {
$links = array();
$identifier = $block->module .'-'. $block->delta;
switch ($identifier) {
case MODULE_NAME-BLOCK_DELTA:
$links[] = array (
'weight' => 3,
'title' => 'Add New Page',
'href' => 'node/add/page',
'access callback' => 'user _access',
'access arguments' => array(‘create page content’)
);
break;
}
return $links;
}


The MODULE_NAME-BLOCK_DELTA should be replaced by corresponded values respecting block's module & delta key, such as the user login block provided by system module is 'system-0'.


Next time I will show how to customize contextual links in Drupal 7.


Thanks for reading.





Source : http://appnovation.com//using_contexture_links_drupal_6_7

Thursday, May 24, 2012

Typesetting Paragraphs on Web Pages




I don’t know who started it, but at some point in the web’s relatively short history, we decided that paragraphs displayed on web pages should be “typeset” in a manner similar to what we see by default in a Microsoft Word document: an empty line after a paragraph, and no indent for each paragraph.


Somehow it was unanimously settled upon that the traditional manner of typesetting paragraphs — with indents and no spaces between paragraphs — is not as readable on a computer screen. In fact, the default styles applied by a browser on paragraph elements encourages the no-indent method. If you throw together an HTML document that doesn’t have any author styles defined, you’ll see the following when you inspect your paragraph elements in Chrome’s developer tools:


Default paragraph styles in Chrome


As you can see, Chrome automatically sets the top and bottom margins for all paragraphs at 1em. Of course, because of collapsing margins, this means there will be 1em of space between paragraphs, not 2em. And if you know your em units then you know that 1em is, by default, basically equal to 16px, although there can evidently be variations in that.


Thus, Firefox does something similar. Here’s a screen grab from an inspected paragraph with no author styles in Firebug:


Default paragraph styles in Firefox


However, it doesn’t seem that everyone agrees with laying out paragraphs in this no-indent manner on web pages. Let’s first go back to a comment posted by Joe Clark on Jason Santa Maria’s blog. He was writing in response to Jason’s post about the newly released A Book Apart title, CSS3 for Web Designers. Clark said:



Now, I know we’re pals and all that, but books are not Movable Type blog posts and we do not write paragraphs with blank lines between them and no indention. (We are not “typesetting” an O’Reilly “book.”)


Apart from simply being wrong and leading to ambiguities when a paragraph ends a page, I find it induces me to leap to the next graf at the tiniest hint of disinterest.


Do please fix.



Here Clark is talking about the fact that the first release in the A Book Apart series has its paragraphs typeset in the modern format, rather than the traditional indent format.


Jason’s response was, in part:



When I originally set the paragraphs with indents, something about the cadence was off. The paragraphs interspersed with the code didn’t quite have the right rhythm. Combined that with the fact that most of the audience probably does the majority of their reading on webpages, it just made more sense to me to go this way.



Interestingly, Jason seems to have since had a change of heart. Although the first two books in the A Book Apart series (including the online version of book #1) use the modern approach for laying out the paragraphs, the method advocated by Clark was chosen for the rest of the books. However, it looks like all the electronic versions of the books use the modern no-indent method for the paragraphs, as shown in the comparison screen grab below taken from book #5 in the series:


Comparing print vs. e-book


So it seems that Zeldman and company have decided that readability on electronic versions of their books is aided by the modern paragraph style. And as a side point, even the Readability app uses the modern style.


But this valid beef that Clark has about typesetting paragraphs is not limited to the printed page. While reading the comments posted on Zeldman’s Web Design Manifesto 2012 (which, by the way, is a must-read for everyone in the industry), I noticed Clark is now pointing out the same problem in Zeldman’s new design:



I’d like your design better if you and everyone in your company and its band of merry men would learn to typeset paragraphs. Microsoft Word is not a model for such typesetting.



And Clark backs up his words. On his own blogs, he styles his paragraphs in the traditional manner. I don’t see a response from Zeldman on that issue.


Is The Modern Method More Readable?


Look everywhere on the web, and you’ll have a hard time finding a website that lays out its content using traditional paragraph structure with no spaces and indents. Personally, I think Clark makes a valid point in the comment on Jason’s blog. First (in relation to print, although it could happen online too), there is a very real possibility that a single paragraph overflowing to a second page could look like two separate paragraphs. And second, due to the scan-everything nature of hurried readers, which I think we unnecessarily encourage, the gap between paragraphs may very well invite less actual reading.


So after all of this, my question is: Are paragraphs easier to read online when presented in the modern no-indent format? What about E-Books? Does the fact that these are read on a digital screen make the traditional method of setting paragraphs less readable?


I don’t have any definitive answers, and it’s certainly hard to argue with the 99% majority who think the modern method is more readable, but I am considering trying out the traditional method when I redesign this blog. After all, the indent at the start of a traditionally typeset paragraph is precisely what CSS’s text-indent property is for.











Source : http://www.impressivewebs.com/typesetting-paragraphs-web-pages

Project Detritus




Zielun asks of managing projects:



It often happens in projects that based on one, large system with tons of modules that can be enabled or disabled, and documentation is often not up-to-date or doesn`t exist at all. At least I have such experience. I know that real problem lies elsewhere like in project management but such things often plays main role when you or team decides which coding standard to pick for a project to solve such issues.



This project detritus can definitely be frustrating. Big projects that go on for extended periods of time begin looking like sediment layers of a rock formation. It becomes an interesting archaeological expedition as you chip away at the months (and years) of development and can almost pinpoint the time that a chunk of code was written based on the style it was written.


I've rarely seen a long running project maintain an absolutely rigid and consistent coding style. We make mistakes in the course of building a project, correct those mistakes, but rarely go back to correct the ill-conceived approaches used at the beginning of a project.


Nobody wants to clean out the cruft for fear of unsettling the foundation and having the entire project collapse on them.


A modular approach, a good naming convention, and an reduction of element selectors can make it much easier to determine what is and isn't being used on a project. Do a search for a module name and you'll discover right away if it is used and where it is used. Tools can be built to automatically review which classes are being used and which aren't.


This is easier to do if you keep styles in the CSS. Don't keep them inline and don't set them in script.


Why avoid element selectors? HTML can change but it's not as easy to tell if the CSS is being used or not unless you examine every instance. How relevant is #sidebar h2 if I've long since switched level 2 headings to level 3 headings?


To be clear, element selectors can be quite useful. Don't throw out the baby with the bath water. Just strike that balance between when to use an element selector and when adding a class would be cleaner, clearer, and more semantic.


Of course, I talk more about this in a little e-book I wrote...*ahem*




Source : http://snook.ca//archives/html_and_css/project-detritus

CoffeeConsole: A Chrome Extension




Harry Brundage, a co-worker of mine at Shopify, does a lot of CoffeeScript development and said he would love to be able to do CoffeeScript right from the console in Chrome's Web Inspector. I asked Paul Irish, a "dev relations guy" at Google, to point me in the right direction on building just such a thing.


The result of today's pet project is CoffeeConsole, a Chrome extension that adds a new panel inside the Web Inspector. Type in any CoffeeScript and then hit the run button (or hit Command-Enter or Shift-Enter). The code will be compiled into JavaScript and then run in the context of the current window.


I've put together a quick video to demonstrate this.



Behind the scenes, I cobbled together a bunch of resources. Namely, the Ace editor and the CoffeeScript compiler There really wasn't a lot of code that I needed to add except to figure out how to run the compiled JavaScript in the proper context.


There's definitely more features that can (and maybe should) be added such as the ability to review the compiled JavaScript and the ability to view the compilation errors. The project has been added to GitHub, so feel free to contribute. (As of writing this, I still need to choose a license but likely an MIT license.)


Download the extension or check out the repo on Github.