Enabling Comments for the literarypiece Content Type

Next, you want to submit a couple of literary pieces and enter a few critiques of other pieces. Still logged in as user dev, do the following 1. Create a couple of test member users, named, aptly enough, James and Joyce. 2. Set permissions for the Workshop Member role. 3. Log in as James and create two pieces. 4. Log in as Joyce and create two pieces. To do this, you want to follow these steps 1. Go to Administer > User management > Users, and click on the ''Add user'' tab. 2. Fill in the...

Getting Initial Feedback from the Client

Because the bottleneck now is getting the client to confirm the Roles and to start writing some short, pithy user stories, contact your client on Skype and look over the site together. The discussion at this point is basically an interview, wherein you first show the list of users and their roles and ask if any important role is missing. Then you confirm the first cut list of user stories. You struggle against ''user story explosion,'' making sure to keep to the main ones only. Then you confirm...

Specifying Structure

Drupal comes with the Garland theme enabled by default. How does the Garland theme specify the structure (layout and positioning of structural elements) of the rendered page Well, actually, you already know a bit about this. Figure 7-1 shows our On-line Literary Workshop in all its structural glory. Notice the shiny new footer message To include it, go to Administer > Site configuration > Site information, and paste something like the following into the Footer message field Powered by< a...

Getting the Test Site Up and Running

Some of this stuff may seem like a bit much, but from my own experience, I really wish someone had spelled it out from the beginning when I got started, because you are going to be saving bellyache upon bellyache by doing it right. (I will spare you the ugly details, but gone is the ugly prospect of having gotten things just right, and then accidentally ruining everything by installing a new module the next day you just use the versioning system to revert back to life as it was yesterday.) And...

How Can I Update Modules Easily and Cleanly

and reflect all that in the version control repository without painstakingly adding, removing, and committing individual files Here's the thing you want to be able to deploy a unique snapshot of your project at any time from the repository, which will be as easy as plunking down a SVN checkout or update on top of a fresh Drupal release install. You saw in the previous chapters how this involves including in this project a state snapshot including all the modules third-party ones you have...

Step Creating the Business Objects

Normally in Drupal, you click the ubiquitous user login block to either log in or register to become a new user. Given the objectives here, however, you can do away with the regular user login registration block and configure Drupal so that only the Translator Team Leader can register users. Instead of registering directly, Clients will fill out a Client Application form, Translators will fill out a Translator Application form, and the Translator Team Leader will then manually create the users,...

Doing What I

Given Figure 8-3, I downloaded using the handy Download link and installed the latest 5.x-compatible versions of the following modules, using the recommended versions in each case GeSHi Filter for syntax highlighting which I use for code listings Google Custom Search Engine TinyMCE WYSIWYG Editor for rich text editing to update, download the latest version of the module and then the latest version of TinyMCE itself as recommended by module instructions from the Moxiecode Systems site, http...

Committing to the Repository and Tagging the Initial Prototype

Well, you have certainly done a good bit of work. Enough already. You are definitely at a point where you would want to commit your work to the repository and call it a day. You will be doing this a lot, every time you finish an atomic piece of work in the future roughly corresponding to each section or subsection in this chapter . So let's just review these three quick easy steps 1. Dump the database You can do this via phpMyAdmin if the database isn't too big and it won't be for quite a...

Step Updating the Drupal Core

There are just two prerequisites here Firstly, you really need to be logged in as User 1 the first user ever created . If you are logged in as an Admin user with full permissions, you can change the password of User 1 if you cannot recall it. It should be written in a safe place with other site documentation. Secondly, if this happens to be a production site, you should definitely go to Administer gt Site configuration gt Site maintenance, and go off-line by selecting the Off-line radio button...

Implementing the Business Objects

In Chapter 1, a first-cut list of user stories was identified see the table in the section ''What Are They Going to Use It For '' in Chapter 1 . The basic objective in creating the initial prototype is to implement the user stories corresponding to each role on a very simple level. This involves a workflow by means of which users of each role can act on a series of business objects They should be able to create, list, select, modify, and or delete them. With the stock, default Drupal you have...

User Story

A Workshop Leader can manage affinity groups. A Workshop Leader can create, list and review, configure and delete groups to which users of the On-Line Literary Workshop belong. When a new user joins the on-line community, she is made a member of a certain affinity group. This will give her access to content only visible to group members. This can be based on the Drupal contributed module Organic Groups. This module should be used to control access to content on the site. By virtue of this user...

Theming Example

Let's immediately do some fancy stuff to the quotes that appear on each page of the On-Line Literary Workshop in an example brazenly stolen from the jQuery home page example. You don't know it yet, but all you need to do is to figure out the selector, chain in an event function, and pipe some action into that. Earlier on in the theming chapter, you created a special PHP template for the nodes of the quote content type. Edit this file in a text editor. lt div class node lt php print node_classes...

Reusing the Collapsible Widget

Here is a most obvious need and a need not easily answered in Drupal 5.x times how to extend Drupal widgets themselves based on jQuery. Let's suppose you have a profile themed with a series of sections and that you wish to make each section collapsible. Let's suppose further, for the sake of argument, that these sections will be themed with a template that receives an array of nodes in the variable nodes. The template is invoked via a callback function, along with the parameter nodes. Here is...

Our onload Example Implemented with jQuery

Go to Create content gt Create page, type in jQuery example one, and set the Body input format this time to ''PHP Code.'' If that format type is not available, go to Administer gt Site building gt Modules, and make sure that the PHP filter module is enabled. 2. Enter jQuery example one in the Title field and the following in the Body field Haikus lt h2 gt Red lt li gt lt li gt Haiku Blue lt li gt lt li gt Haiku Green lt li gt lt ol gt clouds.jpgV alt 'clouds ' gt ', 'inline' lt p gt Haikus...

Housekeeping the SVN Repository and Trac Instance

If you happen to choose svnrepository.com as your repository provider, you simply log into your control panel, fill in a name for the repository no spaces , and click on the ''Create New Repository'' button see Figure 3-2 . Figure 3-3 shows how you are then greeted with confirmation and access info for the newly created SVN repository. With the control panel, you make any necessary user accounts and grant access to your new repository, which is now listed as in Figure 3-4. http aw c bfactory .s...

Full Swing Agile Approach to Drupal Development

This is actually the best part of the book, and the most representative of real-world work. Distracted by upgrades and other wonderment and a lot of stuff going on, you need to get back on track and bring the project to successful closure. Now, at what stage is the project How do you even know Well, that's the reason for the Agile approach a kind of Google Map of your project Pan out for the big vision, zoom in to any area of detail you can easily get your head wrapped around, and break off,...

Load the Database with the Current Database State Grab the details of the mysql

Database you are using, or else locate that info right in the . sites default settings.php file. That's why you set its permissions so it cannot be seen by anyone except the logged-in user. litworkshop example.com public_html sites all backup db grep mysql i default settings.php db_url db_url db_url db_url Load the database with the database state. litworkshop example.com public_html sites all backup db mysql -u dr_workshop -p i dr_workshop lt litworkshop.sql litworkshop example.com public_html...

Using Your Own dev Affinity Group

You decide to take advantage of the affinity group feature to create an affinity group of your own so that you, other programmers, the graphic designers, Pam, and others of her staff can share documents, Acceptance Tests, and so forth, which only the dev affinity group will be able to access. Cool. Drupal is its own best prototyping tool it can even self-document itself This means that if you download the Chapter 5 tarball and deploy it and log in as user dev, when you go to Groups and select...

Adding a Forum Topic

Upon running the Confirmation Test, you get a ''fail'' User joyce can join the group, but when he accesses the group home page, the corresponding group block does not include an option to create a forum topic that can optionally only be accessed by Flash Fiction Enthusiasts. To remedy this problem, do the following 1. Log in as user dev or access the browser that is logged in as that user, if you are using the recommended method of having two sessions open in different browsers simultaneously ,...

Working on the Architectural Baseline

Up till now you have seen the high-level domain model sketched out in chapter 2. You need to verify and extend it and put together a minimalistic document set to prepare the way for the completion of all major decisions as to the architecture of your website application. I recommend using a robustness diagram see the ''On Finding a Common Language'' sidebar in Chapter 1, and Figure 4-10 in order to test the consistency of the user stories taken as a whole, and to create your first detailed...

Standing on the Shoulders of Giants Reusing the Zen Theme

From now on, the theme grows with your website application. It has been conceived and designed with change in mind and will change constantly during its entire life cycle. As you add more functionality in the implementation of each of the user stories, you will be adding more theming, so the presentation layer, now installed in the project, can properly contain the content. This is going to get complicated in a hurry. And there are so many stumbling blocks along the way...

Main Directory Structure for Drupal

As will be repeated many times throughout this book, ''There's more than one way to do it,'' or Tim Toady for short see So you may choose to do things differently from this example. Here I use CVS to manage Drupal core release installation and updating, and SVN for versioning the actual development project itself. Now, although it is absolutely necessary to version the development on the website this is actually everything below the sites directory , it makes no sense whatsoever to version...

Plug Ins

JQuery elegantly has in common with the ''Drupal way'' an extremely lightweight footprint, with just the bare essentials in core, in conjunction with an extremely flexible extensibility framework attained thanks to the addition of plug-ins modules in the case of Drupal . Let's try one. You can find a complete list of plug-ins by category at http plugins.jquery.com . One idea, to replace our own homespun effort in the previous example, is the Effects jTypewriter plug-in, which you can find at 1....

Browsing and Filtering Views of Literary Pieces

Here is where you get to apply what you have learned so far in this chapter to the implementation of Beta Milestone user stories. You have already seen how the Views module allows you to list content items according to various criteria. One common resource often used by Drupal developers for sorting, filtering, and listing content items is the Drupal Taxonomy system, with its Vocabularies, which may be lists of category terms or a set of tags. In order to implement the user story ''A Workshop...

Allowing Filtered HTML Formatting in the Text Area

After investigating for a while to solve this exasperating problem, you will realize that the culprit is the fact that when we created the field for the text, we did not really configure it correctly for a text area. To fix this, follow these steps 1. Go to Administer gt Content management gt Content types, and edit the Literary Piece content type. 2. Click on the ''Manage fields'' tab, and then click on the configure link associated with the field field_literary_piece_text. Scrolling down to...

The All New Devel Module

Before you commit all your work and call it a day on the upgrade path, it will be well worth the effort to include the all-new Devel module in the mix. Just as Earl Miles merlinofchaos has made a tremendous contribution with the Panels you will see this in a later chapter , Views, Nodequeue, and Advanced Help, as well as the Update Status modules, Moshe Weitzman has also, as the author of Organic Groups and a host of other work in the Drupal Community, including the Devel module. The Devel...

Make use of forum containers when planning your forum structure For example in this context you might want a General

Content I On-line literary workshop - Mozltta Fire fox Eile Edit i iew I liitory Dookmarks Ipols Lielp w J 'V amp Hall of l-ame Maqazine On-, X Content On-line literary wor X Create content My account Administer CpntunL iTiiindy iTHirit Books Catflrjorips comments Content Content types Forums Prjsl iHl lingsi RSS publishing Site building Silt tui ifiyui dliun User management Inrji i Help Log out Home Administer Content management Show only items where type is Book page ond whero i statua is I...

Word to the wise Always use a prefix with all machinereadable field names so that they may be easily identified in long

Because the data you want to hold is text, select ''Text Field'' under Text. Then click on the ''Create field'' button see Figure 2-20 . This takes you to the second page of the Wizard, where you are informed that the field application_motives has been created. 9. CCK lets you share field types across content types, so the second page of configuration has Widget settings, which affect the presentation of the field on the current content type and Data settings, thus affecting the field on any...

Weak and Strong Points in Separation of Concerns with Drupal

It is worthwhile noting that while Drupal excels in establishing a clean separation between the presentation, data, and application logic layers, it does have one weak spot where separation of concerns is concerned. Drupal fails miserably at separating business objects and application configuration. This leads to a great deal of difficulty in maintaining production and test sites at times when you are close to launch and while debugging is going on, and even scheduled modifications on...

Adding an Acceptance Test Node

Let's implement the second one first 1. Go to Administration gt Content management gt Content types, and click on the Manage Fields link corresponding to the user_story content type. 2. Click on the ''Add field'' tab, and enter user_story_acc_test in the Field name field, Acceptance Tests in the Label field, and select ''Node reference'' from the Field type dropdown list. 3. Click on the Continue button, select ''Autocomplete text field'' from the dropdown list in the Widget type field, and...

Elaboration Phase Cleanup

The Elaboration phase will be completed once the tasks allocated to the Prototype Release Iteration Milestone are completed, and both the requirements and architectural baselines are set. That will most probably happen during the next chapter, but by this time, you have certainly built up a good head of steam. You probably want to take advantage of Trac's wiki functionality to add a few additional project management artifacts, which cannot be easily reduced or included in user stories or...

Group Home Pages No Longer Showing the Groups Posts

Figure 9-7 shows how the dev group home page shows the description of the group and then lists the posts that have been made within the group. Figure 9-8 shows how the listing of the group's posts has been lost. As you recall from Chapter 6, this is handled by a specially implemented view, by default called og_ghp_ron group home page River of News , which you then learned how to override with og_ghp_table via the user interface by going to Administer gt Organic Groups gt...

Finishing the User Stories with the Client

User Story 4-1 which follows is the first user story Pam wrote and revised after we went over the list the complete set is included in the downloadable chapter resources ZIP file . We struggled to keep the user stories as short as possible, noting that it is better to have more stories than any longish stories. And we agreed that at the same time we should try to avoid ''user story explosion,'' only adding more if they are absolutely necessary. More Information on the First User Story For...

Prototype and scriptaculous

But jQuery isn't the only modern JavaScript library, not by a long shot. Ruby on Rails includes the JavaScript duo of prototype and script.aculo.us to provide similar solutions in its framework. Actually, before jQuery was chosen for Drupal, spectacular integration of these libraries was achieved by Ayman Hourieh, who developed a drag-and-drop portal interface very similar to what Earl Miles's Panels modules offer, where you can define the layout and then drag-and-drop functional blocks based...

Implementing the Clients Workflow

Viewing all texts being translated and their status. Accessing any translation for downloading. Let's use the primary menu not only for the Client's and Translator's registration requests, login and logout, but also for the Client's main navigation options once they are logged in. So to set up the navigation option for the Client, follow these steps 1. Go to Administer gt Site building gt Menus, and then click on the Primary links. You have already added menu...

Upgrading Your Zen Theme to Drupal x

At the end of Chapter 7, you created a subtheme based on the Zen theme system. In order to upgrade it to Drupal 6.x, you are going to have to be a bit drastic because it is a huge jump, but you will still be able to put your prior work to good use 1. Copy your subtheme over to some safe location outside your site. Then remove all themes from the . sites all themes directory. If they are under version control, use SVN for this as follows litworkshop sites svn rm all themes litgarland all themes...