Planet Drupal

Customizing Drupal date field with hook_form_alter and #after_build

BenBuckman.net - July 30, 2010 - 23:57

I spent a long time today trying to figure out how to customize a Date field in Drupal 6. The field is called field_recurring_dates and looked like this:

I wanted the "To" date to only show the time, no date - so the field has Date, Start Time, and End Time. The field is repeating/"unlimited" so the whole unit gets returned via AHAH with the "Add Another Item" button. Renaming that to "Add another day" was easy, but getting the date/time fields to change was elusive. I tried everything else I could think of: #process, theme overrides for every element, preprocess, with no luck. The field is generated by a hook_elements inside the Date module, and I couldn't find the equivalent of a hook_elements_alter ... until I asked on IRC and got the perfect solution from Fox: the Form API's #after_build callback.

So here's the code, finally working, inside a custom module:

function MODULE_form_alter(&$form, $form_state, $form_id) {
  // work on initial node form and AHAH-generated partial form
  if ($form['#id'] == 'node-form' || $form_id == 'content_add_more_js') {
    if (isset($form['field_recurring_dates'])) {
      $form['field_recurring_dates']['#after_build'][] = 'custom_date_combo_after_build';
    }
 
    // rename the 'Add' button
    if (isset($form['field_recurring_dates']['field_recurring_dates_add_more'])) {
      $form['field_recurring_dates']['field_recurring_dates_add_more']['#value'] = 'Add Another Day';
    }
 
  }
}
 
function custom_date_combo_after_build(&$element) {
  // can be MULTIPLE items
  // need to find all the NUMERICALLY-KEYED elements
  foreach($element as $key => &$field) {
    if (is_numeric($key) && is_array($field) && isset($field['value']) && isset($field['value2'])) {
      // remove the Date part of 'To Date's
      unset($field['value2']['date']);
 
      // rename 'From Date' => 'Date'
      $field['value']['#title'] = 'Date';
 
      $field['value']['time']['#title'] = 'From Time';
      $field['value2']['time']['#title'] = 'To Time';
 
      // remove 'To date' block title
      $field['value2']['#title'] = '';
 
      // only need helper text outside whole group
      unset($field['#fieldset_description']);   
    }
  }
  return $element;
}

With a little CSS, it now looks like this:

Perfect!

Categories: Planet Drupal

The Examples for Developers Module

Dale McGladdery - July 30, 2010 - 22:21

An example, like a picture, is worth 1000 words. Until recently Drupal programming examples existed but were spread among documentation pages, blog posts, and the Drupal CVS repository; some searching required. That changed in late 2009 with the introduction of the Examples for Developers module. Its purpose: "to provide high-quality, well-documented API examples for a broad range of Drupal core functionality". Now you can find high-quality, working Drupal 6 and 7 code examples in one place, many with SimpleTests.

The Examples for Developers Module, or simply Examples Module, is actually a collection of modules. Each sub-module contains a single, specific example of how to use an API or implement a feature. At the time of writing there are 17 examples:

AHAH example Demonstrate Drupal AHAH forms Batch example An example outlining how a module can define batch operations. Block example An example outlining how a module can define blocks. E-mail example Demonstrate Drupal's e-mail APIs. Element example An example demonstrating how a module can define custom form elements. Filter example An example module showing how to define a custom filter. Form example Examples of using the Drupal Form API. Menu example An example of advanced uses of the menu APIs. Node access example An example illustrating how to restrict access to nodes based on some criterion associated with the user. Node example An example module showing how define a custom content type. NodeAPI example An example module showing how to extend existing content types. Page example An example module showing how to define a page to be displayed to the user at a given URL. Scaffolding example Provides example scaffolding for a module that maintains its own database table, and exposes an editing interface for the module's data. SimpleTest example Used to demonstrate the SimpleTest test suite. Trigger example An example showing how a module can provide triggers that can have actions associated with them. Vertical tabs example Show how to use vertical tabs for enhancing user experience. XMLRPC example This is an example of how to implement XML-RPC callbacks by implementing a validation suite.

These modules are not just code fragments, they're working examples. Once a specific example module is enabled on the modules admin page (/admin/build/modules) it appears as a menu item in the Admin Menu and can be viewed as a working Drupal web page.

Example Module AHAH Example Page
AHAH example page

Some examples, such as the scaffolding example, also create other administration pages.

Example Module Scaffolding Example Admin Page
Scaffolding example Admin page

The Examples module may not answer all of your coding questions but it does provide a high-quality starting point. Many thanks to Randy Fay for initiating this project and to the many people who have added and improved the examples.

Website: http://drupal.org/project/examples

Categories: Planet Drupal

Drupal theming nightmares part 2

Marek Sotak - July 30, 2010 - 20:33

nightmare
Welcome to the second part of the Drupal theming nightmares series. Not really surprised by the feedback I've got in the previous post. Most of you were enough lucky to stumble on the same problems. While the post was focused on the theming mistakes, it raised a discussion about unfinished jobs too. So if you haven't read it, it is right here: Drupal theming nightmares part 1.

That day, when I found out what I will be working with, I wasn't able to fall asleep (and it wasn't because of the litres of green tea I had). I was thinking about the person/company that wrote it, whether they are haunted in theirs dreams, do they even care? They should, you should, we all should. Take some responsibility for what you are doing. Do it right. I tend to ask people: "Would architect build a house ignoring physics?" Of course not, if he did, people might die. In our binary world we say kittens might die. Familiar right? But this could be another blog post. Lets move on.

Opening template.php wasn't the best idea to do right in the morning. I felt like entering the Camp Blood on Friday 13th. Literally. Uh, is that a db_query() tearing performance apart? Yay, a garland function (garland_preprocess) hanging around? What the hell are you doing there? Ummm, actual html input elements hiding in the corner, waiting to be called as a replacement for login form? Now I need a chainsaw...

read more

Categories: Planet Drupal

using RewriteMap

Karl Scheirer - July 30, 2010 - 19:56

This is an Apache Directive that I've never had to use before, but it came in very handy for a very specific problem.

There was already an apache redirect (RewriteRule + RewriteCond) in place, but the destination URL was case sensitive! That's not normally a problem, but it was for an ad server, and the variables were coming in as uppercase, but needed to be lowercase after the redirect. Bad programming on the part of the ad server in my opinion, but we're not going to let that stop us! :)

RewriteMap to the rescue!

First off, the actual directive is a lot like a function definition, and it can only go in a config file or vhost, it's not allowed in a .htaccess file. Luckily the one we want to use is built in, so we just make it available with:

RewriteMap lc int:tolower

This makes the "lc" function is available in our rewrite rules. We start off with the condition and basic rule ...

# Send ads to new ad server
RewriteCond %{HTTP_HOST} ^old\.ad\.server\.com$ [NC]
RewriteRule ^.*site=([^/]+)/.*area=([^/]+)/.*$ http://newad.sever.net/ad/$1/$2 [R,L,NC]

To use the RewriteMap function in your RewriteRule just change the $N replacement to ${lc:$N}, and you're all set. So for example $1 becomes ${lc:$1}. In our example above, the new RewriteRule looks like this:

RewriteRule ^.*site=([^/]+)/.*area=([^/]+)/.*$ http://newad.server.net/ad/${lc:$1}/${lc:$2} [R,L,NC]
Categories: Planet Drupal

Membase and Drupal

Acquia - July 30, 2010 - 17:39

Barry and I just met with a team from Northscale -- the startup formed to support and extend Memcached, the popular key-value cache used by the largest web sites. We learned about their new database project, Membase, and talked about how it could help high-volume Drupal sites including our Acquia Hosting customers.

Membase is built on the core Memcached technology and supports the Memcached API. I'm excited about what they've done to extend Memcached: Read full article »

Categories: Planet Drupal

Podcast 87: Panels vs Context, The Cage Match!

Lullabot - July 30, 2010 - 17:13

Earl Miles and Young Hahn join Dave Burns, Jeff Eaton, and Jeff Robbins to discuss the similarities and differences between Drupal's Panels and Context modules. Earl is the creator of Panels. Young is the co-creator of Context as well as Features, Spaces, and several other great modules. We open up the cage, toss everyone in, and see what happens!

Also be sure to check out David Burns' article "Assembling Pages with Drupal," which also compares and contrasts Panels and Context.

Release Date: July 30, 2010 - 12:13pm Album: Lullabot Podcast Length: 64:07 minutes (25.1 MB) Format: mono 44kHz 54Kbps (vbr)
Categories: Planet Drupal

Test upload

Damien McKenna - July 30, 2010 - 16:05

Testing out the Drag'n'Drop Uploads module to see how it works.

Categories: Planet Drupal

What's wrong with Mollom?

Randy Fay - July 30, 2010 - 13:58

So Mollom absolutely stinks, as far as I'm concerned.

I just posted this comment on a site that is not mine, but is a Drupal site running Mollom: http://www.istos.it/blog/drupal-training/open-sourcing-drupal-training:

The Examples for Developers project is an open-source training initiative. I'm trying to get it used for developer training and to have books on Drupal development use it for examples instead of rolling their own (which invariably get out-of-date and can't be maintained.)

I encourage you in this (vast) initiative.

And what did I get?
Your submission has triggered the spam filter and will not be accepted.

That's about the fourth time I've taken the time to write a comment on a Drupal Mollom-enabled site, and gotten that kind of a response. How many comments are being rejected inappropriately on sites that use Mollom? Who will ever know?

At the same time, the only site that I have Mollom on, http://hobobiker.com, gets has spam comments approved daily. In fact, it never gets anything *but* spam comments, and Mollom seems OK with that.

What's up with Mollom? This is not good.

Categories: Planet Drupal

Drupalcon Copenhagen multilingual coverage, Jacob Redding talks Localization server

Localize.drupal.org - July 30, 2010 - 12:02

I just had the chance to listen to the latest DrupalEasy Podcast published earlier this week, where Ryan Price and Mike Anello interview Jacob Redding on his work, book, and Drupal's general greatness in many fields. Jacob was an early supporter of the Localization server idea that was built out to eventually power http://localize.drupal.org, so it was great to hear that he gives some exciting coverage of the topic (at about the middle of the podcast). He explains the Localization client and its connection to the server and how these two interact to get as many people submit translations as possible. If you are not using the Localization client yet, this might be a good time to look at it.

In related news, the Backstage with Drupal localization session proposal for Drupalcon Copenhagen passed many levels of the organization committee and was approved for inclusion in the schedule. In that session, two key figures behind features of the Localization server, Gábor Hojtsy and Jose Reyero will talk about how Drupal localization works, and how the client and server fit into the process. Jose will share details of how the server is being used for Open Atrium at the Translate Open Atrium site, and how you can leverage this tool to translate in-house modules as well as client specific modules, themes and customizations. This session is currently scheduled for 2:45pm on the 25th of August in Room 18.

While we'll focus on localization, Amir Helzer and Robert Douglass will present Translation Management for the Enterprise, showcasing the new Translation Management module, which provides a unified user interface on top of the content, navigation, taxonomy, etc. translation process provided by Drupal core and Internationalization module. The module's promise is that "translators can translate everything without having to learn Drupal administration. Node contents, menus, taxonomy, CCK, blocks and strings are all translated from the same interface. Translators need to translate the contents and the module is responsible for putting everything where it should."

At last but not least, the schedule includes a code sprint day right after the main programme. August 27th will not be all about coding only! Documentation contributors, front end techies and translation teams are also welcome! The last European Drupalcon in Paris seen a big gathering of contributors to translations on the then newly launched localize.drupal.org site. Let's repeat that in Copenhagen too! As usual, let us know if you find bugs or missing features crucial for a more effective translation sprint in Copenhagen.

read more

Categories: Planet Drupal

Open Sourcing Drupal Training

Ronald Ashri - July 30, 2010 - 10:19

As Drupal gains popularity, the need for developers is increasing and consequently so is the need for trainers. Let's make sure that the first point of contact for people to the community is a positive experience by open-sourcing our methods of teaching.

How do you explain Drupal to someone completely new to both Drupal and to content management systems? What are the metaphors that people have found work best?

How do you go about introducing hooks and the menu system to developers? Views, Panels, CCK, Context?

read more

Categories: Planet Drupal

The Wysiwyg and CCK multiple value fields

Wim Mostrey - July 30, 2010 - 09:56

Setting up a Wysiwyg or rich text editor in Drupal is a straightforward task: you download the Wysiwyg module along with the library of your favorite editor and you're good to go. You will run into issues when you're using CCK multiple value fields though:

  • You will experience data loss when adding more fields: all content added to existing fields will disappearing when you click the "Add another item" button to add a new field.
  • Depending on which editor you use, there's a chance of hick-ups and data loss when using the drag-and-drop interface to rearrange fields.
  • Depending on which editor you use, you will run into different kinds of unexpected behaviors when adding your first new item after clicking the "Add another item" button. These issues can range from the editor only appearing on the first field, to only appearing on the last field, or from the editor disappearing completely.

The first two issues can be fixed by installing the Wysiwyg API CCK Integration module, which itself depends on three other modules: JS Alter, jQuery Form Update and jQuery AOP. These modules require no configuration: just enable them to fix the problems.

The third issue however is more tedious. I've tried fixing the bug with hook_form_alter() and CCK fields along with the Wysiwyg integration guide but these don't play along nicely. The added difficulty is that the problem varies depending on which editor you use. The only bulletproof "solution" I've found this far is to simply use the FCKeditor editor: it's the only editor that doesn't appear to cause any unexpected behavior. Do note that these problems are only fixed if you use the FCKeditor with the Wysiwyg module: the FCKeditor module itself still has these issues.

Categories: Planet Drupal

Modulecraft: fundraising to make a Drupal DITA documentation distribution

Pronovix - July 30, 2010 - 09:00

This week we launched modulecraft.com a fundraising tool that we want to use to raise interest, involvement and money for the development of a series of tools for Drupal professionals. Pure donation systems like chip-in have a pretty bad track record, but a donation/reward system has to our knowledge not yet been tried in the Drupal community. When you donate you will be contributing to the community AND getting something valuable in return.

We launched the platform with Documentation+, our first fundraising effort which primary aim is the development of a Documentation distro for Drupal.

For a couple of years now, people in the documentation team have been wanting to implement a DITA architecture for the documentation. DITA is an open standard managed that was initially developed by IBM that is now managed by Oasis. It is fairly young, but has gained a lot of momentum in the documentation industry.

We want to build a documentation distribution that uses a similar approach as the localization server and that enables a distributed/federated documentation architecture for the Drupal project. As a Drupal user you'll be able to get a set of documentation from the drupal.org docs server imported into your own site. You will than be able to edit it and build subsets of the documentation for your own projects. You'll also be able to submit topics that were edited or created by you on your own infrastructure and add them as suggestions to the Drupal documentation server. DITA has a modular format that makes it possible to reuse the same documentation topics in different maps, so you'll be able to create dedicated documentation sets for your projects.

You'll than be able to export the documentation in the DITA format, which can with the help of the DITA Open Toolkit in turn be transformed into XHTML, Microsoft Compiled HTML Help (aka Windows help or .chm), Eclipse Help, Java Help, Oracle Help and Rich Text Format and PDF through XSL-FO | reference here.

Using a newer version of the semantic editor/filter/layer system that we developed before, you'll be able to inline add DITA attributes, such as for example audience type (technical, management, end user) or platform (Windows, Linux, Mac).

The DITA distribution, just like the localization server, will be useful for projects outside of the Drupal community. A lot of people are looking for a WIKI style web interface for building DITA documentation, the documentation distribution will give them a platform on which they can build Drupal sites that fit their individual needs.

With this fundraising website we want to involve and commit as much people into the process as possible. If you want to help: submit or vote on user stories, follow us on twitter, blog or tweet about us (check out our banners) and if you can, consider donating.

Categories: Planet Drupal

Using the Evernote module to manage an entire Drupal website with a desktop application

Chris Shattuck - July 30, 2010 - 07:30

This tutorial is sponsored by the Save Joseph campaign. Only 6 more days to save one man from a roomful of teeth. http://savejoseph.org.

I've recently been using the Evernote module to blog, which has made my life surprisingly more rich. After building the module, I started using it right away and found it was the missing piece in creating a workflow that would encourage quality, rapid posting - something I've always wanted to be able to do. Now that its set up, I feel like I can write with virtually no overhead, and using images - kind of tricky when using webforms and wysiwyg - is about as easy as it can get. Even adding annotations is super simple with Skitch (writeup for a workflow with Skitch is imminent).

The ease with which I can create content made me wonder if maybe I could run an entire Drupal site's content off of Evernote. So I gave it a shot when setting up http://josephcowman.com, and it worked like a charm!

What I've done is set up four separate feeds in the Evernote module, three of which correspond to different content types, and a third which imports unpublished blog nodes with instructions for using and administering the site:

The Gallery feed expects notes with a single image. This image is added to an imagefield and is displayed in a gallery fashion on pages like http://josephcowman.com/gallery and http://josephcowman.com/gallery/untitled. The author can put the image anywhere in the post and it will be stripped out using the HTML input filter.

The Blog and Pages feeds, on the other hand, pulls any number of images in and replaces them with local copies of the images, so they would end up looking something like this blog post.

The idea in setting up the site this way is to make management of the content extremely easy. Since Evernote has a desktop application, all the site admin has to do is create or edit a page in Evernote on their computer (even offline), and any changes get pulled into the site on a cron run. So, no log-ins, no working with web forms, it's just working directly with the content without having to deal with the middle man.

I'd love to see more people experimenting with this kind of integration. It makes for a pretty tight workflow. I even take this a little further with my blog (a more detailed article will be forthcoming) by automatically Tweeting and sending my post to Facebook through Evernote as well.

Categories: Planet Drupal

First Drupal site in the Israeli goverment

Linnovate - July 29, 2010 - 21:55

We're very proud to see the first fruit of several months of work and several year of building the Drupal enterprise eco-system in Israel.
The first site shipped, http://shituf.gov.il is a site which exposes the latest rules and discussions from the government to the public.
That way legislators get a very short feedback loop on the current activity and the public gets to state it's opinion and vote up or down on the stream of new rules and political activity.
This "political digg" is the first time in Israel where official governmental activity is letting the public create content in the website and the first time Drupal and it's underlaying open stack is used in official governmental hosting.
The site is seeing great engagement (for instance a rule about monitoring the state of israeli education had 544 votes, divided almost equally and hundreds of comments.
Shlomi Tsadok, Our reprasentitve in the government has led this project and we are showing day after day the flexability, ROI, lower TCO and general awesomeness which is Drupal.
YADGSCTL - Yet Another Drupal Govermental Site Comes To Life (I'm not sure about the popularity of the acronym, but Drupal is gaining popularity in Enterprise Israel and that what counts :) ).
World Domination is now.

Categories: Planet Drupal

View and CCK pitfalls for Drupal beginners

Appnovation Technologies - July 29, 2010 - 19:44
Thu, Jul 29, 2010 by Bono

View and CCK are great for doing a lot of cool things on Drupal sites. However, at the same time there are a few things beginners should beware of when using View and CCK.

1) Filter out those 'not published' contents -- this is probably mentioned in every tutorial, book and video... yet once in a while someone will forget to do it. If something is not set to 'published' you should avoid showing it on your live site.

2) Save that view or you will lose it -- Sometimes beginners will mix up the 'update' button with the actual 'save' button at the bottom. Update is for applying the current changes in your field, filter etc. Nothing is actually saved until you press that 'save' button. Even if you can see the changes in the preview it doesn't mean your changes are saved.

3) Which view are you editing? -- After you saved a view the focus shifts back to default view. If you have a page and a block view under the default view and only want to edit one of them then make sure you select the right one before making changes again.

Categories: Planet Drupal

Drush, Drush Make, other Drupal packages, and development setup for openSUSE

Jimmy Berry - July 29, 2010 - 19:15

I have recently added drush and drush make packages to my openSUSE repository. For more information or to report bugs on the packages please visit their respective project pages: drush and drush_make.

To install the packages you can use the one-click installers provided by the build service or manually add my repository and install the packages as shown bellow.

  1. su
  2. zypper ar http://download.opensuse.org/repositories/home:/boombatower/openSUSE_11.[2 or 3]/ home:boombatower
  3. zypper in drush drush_make

Also note my existing Drupal packages: drupal-dev and drupal-vhosts, as well as the LAMP Drupal one-click pattern. The latter package (drupal-vhosts) is very useful in setting up a multi-drupal version, multi-subdomain work environment.

To use simply install and run the command to point the virtual hosts to the directory containing your Drupal code.

  1. su
  2. zypper in drupal-vhosts
  3. drupal-vhost /path/to/main/software/directory

Either edit the hosts file directory or use YaST -> Network Services -> Hostnames to add an entry for every Drupal version you wish to run (package currently supports 6, 7, and 8). The relevant lines from my /etc/hosts file are as follows.

  1. 127.0.0.1 d7x.loc
  2. 127.0.0.1 d6x.loc

For my setup I use /home/boombatower/software for all my code with Drupal cores in drupal-7 and drupal-6 directories respectively. If you want to have subdomains for your sites just add more entries to /etc/hosts and use the respective Drupal sites directories.

Personally, I then create symbolic links to all my modules so that the code resides in the root of the software directory, but can be used by any respective site. This makes the paths to modules and what not much shorter and easier to reference from multiple specific sub-sites and what not. For example to link pathauto to the all modules directory for Drupal 7 I would execute the following.

  1. ln -s ~/software/pathauto ~/software/drupal-7/sites/all/modules

Or from within the sites/all/modules directory as I tend to do.

  1. ln -s ~/software/pathauto .

Also note, to enable mod_rewrite and get clean URLs to work simply go to YaST -> System -> /etc/sysconfig Editor then Network -> WWW -> Apache 2 -> APACHE_MODULES and add rewrite to the end of the line. You can do so manually of course as well.

In order for the virtual host changes and apache module addition to take effect you will need to restart apache and for the /etc/hosts changes you need to restart the network which you can do with the following commands run as root.

  1. rcapache2 restart
  2. rcnetwork restart

The end result of all this work is beautiful URLs like: http://d7x.loc/node/1, http://foo.d7x.loc/user, and http://d6x.loc/.

I also create a similar structure within MySQL. First I set an easy to remember MySQL root password since really no reason for it not to be easy to remember and helpful when having to enter it a lot.

  1. mysqladmin -u root password EASY_TO_REMEMBER_PASSWORD

Next setup a drupal user in MySQL and give the user all permissions to d7x* and d6x* named databases which allows us to use a single user for all our drupal sites (much easier to remember login info) without having to update privileges all the time. I name my databases the same as virtual hosts, so for d7x.loc I would have d7x as the database name and for foo.d7x.loc I would have d7x-foo.

  1. CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'EASY_TO_REMEMBER_PASSWORD';
  2. GRANT USAGE ON * . * TO 'drupal'@'localhost' IDENTIFIED BY 'SAME_EASY_TO_REMEMBER_PASSWORD' ;
  3.  
  4. GRANT ALL PRIVILEGES ON `d7x%` . * TO 'drupal'@'localhost';
  5. GRANT ALL PRIVILEGES ON `d6x%` . * TO 'drupal'@'localhost';

Anytime you want to add a database for a new site simply run the following.

  1. CREATE DATABASE `DATABASE_NAME` ;

Enjoy you fancy development environment!

Categories: Planet Drupal

A Developer’s Guide to What’s New for Drupal 7

Drupal Connect - July 29, 2010 - 18:45

There are approximately 38 critical issues that need to be resolved before Drupal 7 beta gets released. For more on these beta blocker issues check out: Drupal Core Improvements.

With this post I want to encourage you to install Drupal 7 alpha, test it out, and ultimately help to fix the critical issues and speed up the beta release.

You'll need a localhost LAMP or XAMPP environment to follow along with the examples here. If you don't have one set up I recommend using the Acquia Stack Drupal Installer.

Once your testing environment is configured, download Drupal 7.

Installing D7

Save the installer to your localhost Drupal /sites folder and extract it. Set up your MySQL database using your preferred method. Note to developers: D7's new database abstraction layer will theoretically support multiple database types including SQLite, PostgreSQL, MSSQL and Oracle. So if you are running Oracle you may be able to use D7.

Now load the installer page in your browser (note I renamed my extracted folder to drupal7): http://localhost:8082/drupal7/install.php. The install process is about the same as D6 - you're still going to need to copy your /sites/default/default.settings.php file and re-name it to settings.php. Also make sure to create your /files folder. Make sure the file has write permissions for the install process. Once you do this and have your db created let's run the installer.

One immediate difference with the installer is that D7 now offers you a Standard or Minimal install profile. Standard will install D7 with common Drupal functionality and features that you are familiar with. Minimal is the choice for Drupal developers who want only the core Drupal functionality enabled. I'll leave it set for standard profile.
 Select an installation Profile

Navigate through the installer screens choosing language; and adding your database information.

Enhancements

With D7 installed what are immediate noticeable enhancements? Overall look and feel of the administrative interface now uses overlay windows to present links to sections and content, as this will make Drupal Development easier. Navigation in the admin interface now runs horizontally along the top of the site. Directly under the toolbar navigation is a shortcut link navigation. You can customize this by adding your own shortcuts pointing to various admin functionality.

Drupal 7 Administration

In the toolbar, Content points to your content lists. Structure contains links to Blocks, Content types, Menus and Taxonomy. CCK is now built into Drupal 7 so you can create custom content types and manage custom fields without having to install modules. If you want to restore the user interface to look more like D6 you can do this by disabling the Overlay module or tweaking role permissions for the Overlay module.

Content Types

Two content types come enabled with Drupal 7 core. Article replaces the D6 Story type. Basic Page replaces the D6 Page type. Drupal Developers hope these more accurate names will help new Drupal users understand how to add content easily to their site.

Appearance (Themes)

Themes are now under the Appearance section. There are 3 new themes: Bartik, Seven and Stark. Bartik comes enabled during the install. Garland makes a return from Drupal 6. You can also easily set your Administration theme easily from the same main Appearance screen.

Drupal 7 appearance admin page

A huge enhancement is the ability to install contributed themes directly from the Appearance admin page.  Clicking on the Install new theme link will load a screen where you can paste in the path to the theme's tar.gz file or upload directly from your desktop.

 

Users and Permissions

People love user administration and permissions. In D7 users can only edit and delete their own content by default. You can bypass this by checking the Bypass content access control in Node permissions. Each time you add a custom field there are no longer specific permission checkboxes for those fields that you need to check by default. Field permissions will most likely be handled in D7 using a contributed module such as Field Permissions (http://drupal.org/project/field_permissions) which is still being developed.

Modules

Modules loads the module administration screen. You can run cron and check for updates via links directly from this overlay. Like the Install new theme feature you can use the Install new module link to run your contributed module installs directly from their Drupal project page or uploaded from your desktop.

Site Configuration

The Configuration overlay also enhances organization. People, Content Authoring, Media, Search and Metadata, Regional and Language, System, User Interface, Development and Web Services provide easy jumps to site configuration.

 

Reports

Reports contains a new feature called Field list. This presents a reference listing of all your custom and core content type fields.

 

Conclusion

Overall Drupal 7 is an exciting release due to significant improvements in user and admin interface. The Overlay windows are impressive. The new sectioned navigation will make it easier for users and admins to move around within the site; and the new module installer functionality is definitely something to rave about. There are a lot more enhancements and changes. See if you can locate them and attach a comment to this post telling us what you've found and what you think of D7.

About the Author:

Trevor James currently writes on all things Drupal for Drupal Connect, a Drupal Development Company. You can view more of his Drupal writing at his Web site: http://variantcube.com/.

Categories: Planet Drupal

Using a settings page to change the number of results in a view

agileapproach.com - July 29, 2010 - 17:09
Many sites have views that are used to generate a large number of sections/pages on the site, and you may want to easily change the number of results without having to edit the view. It's easy to create a settings page that will allow you to configure the number of results.
Categories: Planet Drupal

New suggestion export and deeplinking features on localize.drupal.org

Localize.drupal.org - July 29, 2010 - 16:12

We've launched the Drupal.org redesign theme on localize.drupal.org about six weeks ago, and the reception was great. While other subsites like api.drupal.org are also in the process to migrate to this theme, we could pioneer some fixes and get them into production. We keep tweaking the theme on this site and get fixes in based on your feedback.

Some great feature additions landed since the last update. The most requested new feature is that you can now export all outstanding suggestions with translations. In case of multiple outstanding suggestions for any one string, the suggestions will be in comments. In case of single suggestions, the export uses Gettext's fuzzy facility and just marks the string as "not ready". Look for this option on the language export screen.

Another great feature which should help translation sprints and discussion around concrete string translations in general is the possibility to link to each individual source string. You can reveal the list of links for each string on a translation page by clicking on the # (hashmark) in the source string table header. This will show links with IDs for each source string. You can bookmark these or use them to discuss strings in forum discussions or chats. The "Welcome to Drupal..." string in Hungarian for example can be deeplinked as http://localize.drupal.org/translate/languages/hu/translate?sid=251536

We also put down our legs on drupal.org! Now every project page on drupal.org includes a link to "View project translations". For example http://drupal.org/project/views will link to the corresponding project page at http://localize.drupal.org/translate/projects/views which gives you status information and download links to specific Views translations.

Since the last update, we've opened some new teams. Recent additions include the Portuguese International, the Gujarati and the Haitian Creole team. Welcome! The process for new team additions is explained on the front page.

Finally, on some technical notes, the main drupal.org site was the first to employ a Bazaar and Hudson based deployment system recently to ease our collaboration on new features. This week localize.drupal.org joined this system, so our code is now fully hosted and managed there.

read more

Categories: Planet Drupal

Drupal Voices 140: Nathaniel Catchpole on Drupal 7 performance improvements

Lullabot - July 29, 2010 - 16:08

Nathaniel Catchpole (aka catch) talks about some of the performance-related patches that he has been focusing on for Drupal 7. When Dries gave his State of Drupal keynote address in DrupalCon San Francisco, he presented the Top 20 Drupal 7 core patch contributors and catch was at the top of the list with over 337 patches that he was involved with by that point. He notes that a lot of his patches were a series of smaller performance-related patches that he discovered by using profiling tools such as XHProf and XDebug. He talks about some of the performance changes that got into Drupal 7, as well as how he's been able to work on Drupal 7 core through his job at Examiner.com.

At the time of this recording there were over 120 critical issues for Drupal 7, and at the moment there are around 41 critical issues in the Drupal 7 issue queue.

Release Date: July 29, 2010 - 11:08am Album: Drupal Voices Length: 12:49 minutes (11.79 MB) Format: mono 44kHz 128Kbps (cbr)
Categories: Planet Drupal
Syndicate content
 
 

Drupal is a registered trademark of Dries Buytaert.