Recipe Views Bulk Operations Content administration

Completed Recipe 7, Admin Role Views Bulk Operations module - 184 - Views Bulk Operations (VBO) could just as well be called the Better Site Administration module. Let's start by looking at the content management page that comes with Drupal core at admin content node. Promote to front page Demote from front page Make sticky Remove stickiness Delete j Query bppkrfwktett expand all fieldsets j Query bppkrfwktett expand all fieldsets The form's user experience is a bit clunky, often requiring...

Recipe Integrating the Tracker View with the Tracker module

Enable the tracker module at admin build modules. It is a core Drupal module so you don't need to download anything (if the comment module is not yet enabled, go ahead and enable it since it's required for tracker). 2. Go to the My Account page. A link is located in your Administration menu. You may also visit Administer User management Users (admin user user), and click on a username. Note the new Track tab. 3. Notice the URL for this tab, http YOURSITE.com user 1 track. The 1 in the URL is a...

Adding content

Optional Add a taxonomy category for Artist to the Audio content type, at admin content taxonomy add vocabulary. MP3 tags also known as ID3 tags offer a single field for Artist. If we choose to add a taxonomy field for Artist, we will actually be required to enter the artist name more than once, but it's an easy way to make sure that multiple artists can have their own page on the site. It would be hard, for instance, to offer a separate page for songs by Naomi Bernstein with the MP3 Artist...

View setup

The setup for our view will be fairly easy. Go to admin build views and click on the Add link for the Audio default view. Review the view settings, and Save. 8. Consider removing the post information Submitted by Username on date for the audio type at admin build themes settings. 9. Enjoy the view at http YOURSITE.com audio. You may click on an individual artist to view all of his or her pieces. Note the Click to play link that appears for audio files not encoded with one of the...

Example Setting up Cron using cPanel

If you have a hosted account you may have a control panel that grants access to cron job configuration. 1. Logon to your host cPanel and click on Cron jobs. 2. Select to start with the Standard option. 3. The Standard interface does not offer the option to run cron every 30 minutes. If we choose 30 minutes here, it will run cron once per hour at half-past the hour. Select 30 minutes. 4. Enter a command to run such as the following usr bin curl --silent --compressed http www.example.com cron.php...

[Ingredients

Recipe 70, completed to at least Step 8 This recipe has two major goals. The first is to remove the link to the parent feed that appears under each node in Recipe 70. The second is to provide a slate for implementing the debugging strategies found in the next recipe, to help you to figure out how to make such tweaks on your own. The SimpleFeed module creates several links in the links array, which many people will find to be extraneous. The SimpleFeed documentation simply says If you want to...

[pack

The item requiring special attention is the Parent Feed Node ID. Use the Node IDs determined in the previous step. SimpleFeed Feed Item Parent Feed Node ID is All of Select the correct Parent Feed Node ID SimpleFeed Feed Item Parent Feed Node ID is All of Select the correct Parent Feed Node ID

Import Calendar items

Enable the iCal module that comes packaged with the Calendar module. 2. Identify the iCal feed from a web site, and copy the iCal URL. In most browsers you may right-click, and select Copy link location. Of course, this is only possible if the web site provides an iCal feed. 3. Configure the iCal settings at admin settings calendar calendar ical. The path to get there is Administer Site Configuration Calendar Setup iCal. Enter a name for the feed, the iCal url, and a Default link. Baltirnore...

Recipe Body classes

Body classes might sound, at first, like a great way to lose weight and get strong, but in the context of a Drupal web site they are simply a set of CSS classes on the opening body tag. Examples might include lt body class sidebars gt lt body class sidebar-left gt lt body class front logged-in one-sidebar sidebar-left gt This may not look that exciting, but body classes actually yield a lot of power to Drupal themers. For our example, let's consider a site set up by the designer to include a...

Create a Website Snapshots View

Create some content items at node add link. 10. Create a new view at admin build views add. Description Website snapshots, using the websnapr service Link - Option Preview image small Link Link - Protocol Is One of http, https 11. Click on Save and enjoy the view at While the screenshot is being prepared, it may temporarily look like this

Creating a new view based on websitesnapshots

Make the following modifications Web site snapshots, using the websnapr service Fields Node Title Delete this field Link Link field_link Change Option to Title, as Link Link field_link that had Delete this field been formatted as a Preview Image small 7. Place the block at admin build blocks into one of the sidebars, and save the block. blogroll right sidebar v 10 v configure Map of House Committee on Agriculture

Recipe notes

Install the Views Fast Search - Node type rankings module, which comes with Views Fast Search, to prioritize selected content types in the search results. Configure this module at admin settings vfs_ranking_nodetype this module may slow down your search . Install the Porter-Stemmer module to be able to find a word such as blogging when searching for blog from http drupal.org project porterstemmer. Install the Porter-Stemmer module to be able to find a word such as blogging when searching for...

To Views

To apply a patch, go to the command line in the module directory usually sites all modules views or one of its subdirectories and type These patches are not guaranteed. Be sure to read the issue posts, test the patches in a development environment, and report your results back to the issue queue. A complete list of Views 1 patches is available at 'node id' argument handling fails on str type values Can't have taxonomy argument and filter Arguments Type Taxonomy Name of Term Add argument handler...

The Menu Options

Tabbed navigation enables each view to have a link to the other specified views. Thus, the Views module offers a powerful and easy-to-implement navigation system. In the theme displayed above, the current tab, Recent popular content, is underlined. It is also designated in the view as the default menu tab. That's why it is available at in addition to its officially-named URL, In Drupal code, navigation tabs are part of the menu system. These tabs are called menu local tasks One default tab may...

Creating the Media Hit and Press Release Content types

Create two content types, one named media_hit and one called press_release at admin content types add. Name Media Hit Press Release Description Each Media Hits will Press Release reference press releases referenced by Media 3. Add fields to the content type, as follows admin content types media-hit add_field Use this URL for creating both fields below. Date - Select List Deselect Hour and Minute in the Granularity settings admin content types press-release add_field Use this URL for creating...

Install and configure sIFR

Install and enable the sIFR module http drupal.org project sifr. 8. Create a sifr subfolder of the sifr folder at sites all modules sifr sifr. 9. Download sIFR at the bottom of the page at http www.mikeindustries. com blog sifr . 10. Copy the following files of that archive into sites all modules sifr sifr D sifr.js D sifr-addons.js D sIFR-print.css D sIFR-screen.css Steps 7-10 may be accomplished at the command line with the following steps be sure to check for current versions in the wget...

Recipe Date badge

CCK module http drupal.org project cck Date module http drupal.org project date Enable Date, Date API, Date Popup, and Date Timezone modules Node Go To module http drupal.org project nodegoto _ Recipe 34 _ In this recipe we create little calendars, or date badges that display the dates of upcoming events. The badges will display in nodes, teasers, and views. mW-tm Buyer-Grower Meeting - Baltimore J J Date 02 11 2009 f y Wednesday, February 11th 9 am - 3 pm Oregon Ridge, Cockeysyjlle, MD For...

Recipe Proximity Search

Completed Recipe 61 Views Custom Field module In this recipe we'll create two different views. The result will be a listing of Senior Centers with a link to a view of the nearest Trailhead Parking areas. We'll create a Senior Center content type, with a Geocoded address marker field recall that the Trailhead Parking content type uses a Map marker field, the Recipe Notes contain a detailed comparison of the five CCK field types . 2. Install and enable the Views Custom Field Module. 3. Create a...

Removing duplicate search engine results

It is good practice to prevent search engines from indexing duplicate pages. For instance, after moving the front page to the actual home page, there is no need for search engines to index the separate http YOURSITE.com frontpage URL. 15. Log on to your host, and edit the robots.txt file in your Drupal home directory. Add the following line to the Directories section Disallow frontpage From the point of view of a search engine, this URL involves a frontpage directory even though there is no...

Recipe Exposed Filter settings

Completed Recipes 34 and 35 The Exposed Filters fieldset provides four options, as shown The handbook page for filters http drupal.org node 54457 offers helpful documentation on these options. After studying that page, the best way to get to understand these filter options is simply to try them. While testing the options keep an eye on both the Filters and Exposed Filters fieldsets two of the options Filter settings Default and Lock Operator correspond directly to settings in the Filters...

Patch the Node Reference module

At the time this recipe is being written, a patch is required to the Node Reference module. A few caveats apply. First, check to see if the patch has already been applied. Go to http drupal.org node 12 34 8 2 and note the Status in the information block. If the status has changed to Fixed, you won't have to perform this patch, and you may skip to Step 4. 2. If the patch must be performed, be sure that the patch version is appropriate for your version of CCK. Determine the CCK version at...

Formatters

In the Views UI, formatters display as a drop-down list of Field Options. Formatters are discussed in Recipes 25 to 27. JThis material is copyright and is licensed for the sole use by Richard Ostheimer on 26th June 2009 2205 hilda ave., , missoula, , 59801 drupal.org project gmap_addons drupal.org node 187640 Default Preset Name Preset Name as link to node jQuery Gallery View for CCK multiple imagefield Default link to node link to image path to image url to image Default Skip Empty Fields...

Views Taxonomy and Content setup

Identify the taxonomy view you wish to use for this exercise. In the example we will use a page view called products, which displays a table with three fields Node Title, Product Sell Price, and Product Buy it now button. We'll filter for the Product content type, and implement a Taxonomy Term Name argument. If you do not wish to install Ubercart, simply create a content type called Product, apply taxonomy terms to it, and create a taxonomy view. A taxonomy view uses a term or term ID as an...

Views Checkboxes

Replace select lists in Views Exposed Filters with checkboxes or radio buttons with the Views Checkboxes module, available at http drupal.org project views checkboxes. Configuration for this exposed filter is shown below Replace multi-select boxes with checkboxes, Enable this to replace all multi-select view filter form elements with checkboxes. LZl Replace single-select boxes with radio buttons. Enable this to replace all single-select view filter form elements with radio buttons. Limit Do not...

Recipe Carousel View

Completed Recipe 60, Steps 1 and 2 jQuery Update jCarousel http drupal.org project jcarousel Carousel http drupal.org project carousel Enable the Views Carousel module Note This recipe does not use http drupal.org project viewscarousel This is something of an uber-recipe in terms of the sheer number of required modules. On the flip side, we won't ask for much exploration of code, as we have in some other recipes in this chapter. Once everything is installed, we're going to basically make a few...

Recipe Views UI permissions

Masquerade module http drupal.org project masquerade _ There is no doubt about it The Views UI is powerful. Given its complexity, many site administrators will benefit from a pared down interface. The Views UI Permissions module restricts access by role to selected fields and fieldsets in the views interface. The Masquerade module will facilitate our work, as we switch temporarily from one user to another, while testing this functionality. 1. Install and enable the Views UI Permissions and...

Views Hooks for Coders

The following hooks are frequently used by module developers. Create Views arguments array, including name, help text, handler code, and options Create default Views See Chapter 2, and Appendix A . Create array of style plug-ins. These style plug-ins populate the View Type selection list in the Views UI. See also Chapter 4, and Appendix C. Create tables objects for use by Views The most common Views hook. See http drupal. org handbook modules views api for more information. Be sure to read...

Example Using the Poormanscron module

Poormanscron module http drupal.org project poormanscron I If you do not have access to the cron utility on your host system install Poormanscron. The module invokes the cron hooks of all enabled modules at periodic intervals. 1. Install and enable the Poormanscron module. 2. Configure the module at admin settings poormanscron. Set the Cron runs interval to 30 minutes. Runs Drupal cron jobs without the cron application, Minimum number of minutes between cron runs. Cron will actually execute...

Setting up the Pie Chart Content type and View

Install and enable the first five modules in the ingredients list. Note that the Regenerate module is not located in the regular Drupal contributed module repositor it is a small module that a user uploaded to the module's issue queue. This module overcomes a quirk in the Computed Field module that changes in the computed field require each node to be re-saved. This module does a bulk save of each node in a selected content type a huge time-saver and annoyance-reducer. 2. Create a new...

Setup Google Maps Tools

Install and enable the modules listed in the ingredients. Instructions for installing jQuery Update are found in Steps 1 and 2 in Recipe 60. 2. Ensure that Clean URLs are enabled at admin settings clean-urls. 3. Visit to get a Google Maps API key. Enter the domain name of your site, and check that you have read and agree to Google's terms and conditions. Press the Generate API Key button, and copy the key to the clipboard. 4. Paste the Google Maps Key into the Google Maps Tools configuration...

Using an Alternative Imported View

For an alternative view to see additional possibilities with Views Fast Search go to admin build views import, and import the view found at Be sure to remove the first line containing the PHP tag before pressing the Submit button. Change the URL to search alt before saving the view. 8. Visit the search URL, at http YOURSITE.com search alt. View Edit Clone Content Export Ustrrs Dev load Dey-cia amp rjs.s Dev items View Edit Clone Content Export Ustrrs Dev load Dey-cia amp rjs.s Dev items...

Recipe Views Bonus Pack Export

Drupal Views Export Xls

Views Bonus Pack module http drupal.org project views_bonus Bonus Views Export module comes with Views Bonus Pack, above The Views Bonus Pack comes with a number of style plugins. They are listed in the Views Style Plugins, Appendix C. One Views Bonus Pack module that is definitely worth incorporating into common practice is Views Export. The sample view below assumes that the location module is installed. However, any fields available to Views may be selected for export. 1. Install the Views...

Working with Default Views

Right out of the box, the Drupal Views module provides six pre-made default views that you can rapidly incorporate into your site. While serving your site, the default views can also serve as a valuable learning resource, providing keys to understanding a number of advanced Views features. Using default views as examples we will have the chance in this chapter to introduce all but one of the primary Views fieldsets. With only core Drupal and Views installed, you will initially see just four...

Modules

We covered default views that are part of the views module in Chapter 2. We also implemented and sometimes modified default views for Audio, Calendar, Timeline, Views Bulk Operations, and Views Fast Search modules. This Appendix includes almost 175 default views. Module Name File Location of Default View Code Activity Stream activitystream activitystream. module Bibliography biblio biblio.module Module delicious.com Activity Digg Activity Random Audio User's Audio User's Audio Feed backlinks...

Recipe Views UI Sort

Views UI Sort module The Views UI Sort module addresses a long-time annoyance for Views administrators that field names are not alphabetized in the user interface. 1. Install and enable the Views UI Sort module. 2. Go to admin build views, and notice the new tab available Views UI Sort. Click on it, and set the Fields Filter sort to Simple Alpha-Numeric. This configuration item is also available at admin settings view_ui_sort. -View UI Sort - Sort Options Fields Filter sort Select a sort option...

Recipe Views Custom Field

Any table, or list view, such as swim_groups Recipes 3 and 4 Relatively new and little-known, the Views Custom Field module can be quite handy. Use it to add row numbers, node IDs, special links, or whatever suits your needs. Once the module is installed, simply add the Views Custom Field and enter a label and a value. 1. Install the Views Custom Field module. 2. Clone the swim_groups view, and make the following changes Add a Views Custom Field Text field. Set the Label to ID and the Value to...

Recipe You Tube Video

An existing view this recipe is easy to adapt to a new view, as well In this recipe, YouTube and Views do all the heavy lifting, while our work is easy. A minute's effort will place a bar of four pop-up YouTube videos at the top of a view. 1. Visit the Google Video Bar Wizard at http www.google.com uds solutions wizards videobar.html. Geocle Code Home gt Google AJAX Search API gt Wizards gt Video B.n Embed a strip of YouTube videos on your on your web page and let your users watch the video...

Export Calendar items

Edit the calendar view at calendar edit. Add a fourth argument of Calendar iCal Feed and set the Default to Display All Values. 6. Go back to the calendar view and notice the little calendar icon Ty. 7. Click on the icon and download the iCal file. 8. Go to the calendar service of your choice and upload this link. We will use Google Calendar in this example. Go to Google Calendar at calendar. google.com and click the Add link that appears below the Other calendars. Choose Import Calendar....

Recipe Views Bulk Operations Taxonomy assignment

Completed Recipe 17, or applied patch at http drupal.org node 1996 75 Actions module http drupal.org project actions The Views Bulk Operations module sometimes called VBO, for short comes out of the box with powerful functionality as demonstrated in Recipe 50. Yet even more functionality is possible when combined with the Actions module. In this example, we enable bulk assignment of taxonomy terms for selected content items. 1. Install and enable the Actions and Taxonomy modules. 2. Create a...

Recipe Views Calculations

Views Calc module The Views Calc module offers sums, counts, and averages for view rows and columns. The module does its math on a page-by-page basis, so the easiest way to perform a calculation on all the items is to set the view's Nodes Per Page value to be equal or larger than the number of nodes in the view. 1. Install and enable the Views Calc module. 2. Clone the swim_groups view, at admin build views swim_groups clone. Name the view swim_groups_count and change the url to...

Node Sticky

This is the first recipe in the book that uses the Teaser List-View Type. The teaser includes the first portion of the post, along with a Read More link to the full text. The Read More link typically appears in a separate line, together with Comments, and New comments links. Recipe 13, below this one, offers a nice tweak to make the Read More link easier to find. You may alternatively choose to show the Full Nodes or a List View. If either Full Nodes or Teaser List is selected, it is not...

Sort Criteria fieldset

Review the Sort Criteria fieldset. The frontpage view places Sticky nodes at the top, and then performs a secondary sort by Created Time. Typically, Drupal themes will create a lt div gt with a sticky class so that these important items can be styled differently via CSS. Node Sticky Descending A Sort by whether or not the node is sticky. Choose descending to put sticky nodes at the top. Node Created Time Descending Normal S T Sort by the submission date of the node. Note the helpful text,...