06.05.2013 Views

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Here is a labeled screenshot showing how we need to configure our view:<br />

[ 223 ]<br />

Chapter 7<br />

We will go through the arrows in the previous screenshot, starting with the arrow<br />

labeled 1. Note that when you change a setting in views, the changed value has a<br />

different background color (pale yellow, by default) than unchanged values. In our<br />

grayscale image, this does not show up well.<br />

1. Choose Page from the drop-down list <strong>and</strong> click on the Add display button.<br />

This tells the Views builder that we are building a new page, not a block,<br />

feed, or something else. When you first do this, your page will be labeled<br />

Page, not JSON Content.<br />

2. A page needs a path. Click on the Path item in Page Settings <strong>and</strong> set the path<br />

to newest_<strong>com</strong>ment. This assigns a relative path that we will use to construct<br />

a URL.<br />

3. Next, we have several things to set in the Basic Settings area. Name (JSON<br />

Content) will help us distinguish this display from others. Style needs to be<br />

set to JSON data document to indicate that we want JSON data for the entire<br />

document, <strong>and</strong> Row style should be Unformatted. This is used when styling<br />

tables or lists <strong>and</strong> JSON doesn't need styling. In the screenshot, I set the Title<br />

property, though it has no impact on JSON data. Finally, set Items to display<br />

to 1, since we only want one <strong>com</strong>ment.<br />

4. By default, we are working with <strong>com</strong>ment objects. We also want information<br />

about related nodes, so we click the + (plus) icon in Relationships <strong>and</strong> add<br />

Comment: Node. This will make information about related nodes available<br />

to us.<br />

This material is copyright <strong>and</strong> is licensed for the sole use by Richard Ostheimer on 18th June 2009<br />

2205 hilda ave., , missoula, , 59801

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!