Activity Creating the priorwork Page display

We're done with the default view, next we'll create our Page display. This will be used to produce the list of prior work from which the user can select. It will always have content, while the portion of the web page that shows the details will only show such content once a selection has been made. The details section is larger than the list, but its content is subordinate to the content of the list, and that makes the list a logical choice for a Page display, and the details for an attachment display, since an 'attachment' implies something subordinate.

Page

I Ads Clip ay

1. The first setting to make for our Page display is the path. We want the URL for the view to be prior-work.

Page: The menu path or URL of this view http ://loca I h o st/guildb uild ers i nc.co mj | prior-work! |

This view will be displayed by visiting this path on your site. You may use ""Mi" in your URL to represent values that will be used for arguments: For example, "node/'Wi/feed",.

Update

Cancel

2. Title the view Previous Projects.

Page: The title of this view

Status: using overridden values. [ Use default

Previous Projects

This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.

I Update I I Cancel |

3. We're going to want to offer paging, since we're only showing up to 10 titles in the list, and there will be more than that many prior jobs. Don't forget to click Override, so that the pager setting only affects the Page display. We'll offer full paging, since the mini pager is confusing to some people. At this point, I don't think there will be any other elements on the page that have a pager associated with them, so leave the index for this one set at 0. If it doesn't appear on the page when we test, we can come back and change it to another number at that time.

Page: Use a pager for this view

Status: using overridden values. [ Use default |

Pager element:

Unless /ou're experiencing problems with pagers related to this view, you should leave this at 0, If using multiple pagers on one page you may need to set this number to a higher value so as not to conflict within the ?page= array. Large values will add a lot of commas to your URLs, so avoid if possible.

4. So far, we've specified how to select rows—via our filters—but not any information to be displayed from them, and the warning messages in the Live Preview area are a constant reminder of that. Let's fix that. The fields that we'll select are the node ID (nid) and the node title.

5. The only field we need to display is the node title, which, in our Job content type, is the name of the Job (see Appendix B). We need the nid for use in the next step, but not to display. Remember to click Override before submitting.

Page: Configure field Node; Nid

Status: using overridden values.

[ Use default J

Label:

The label for this field that will be displayed to end users if the style requires it.

IZl Exclude from display

Check this box to not display this field, but still load it fn the view. Use this option to not show a grouping field fn each record, or when doing advanced theming.

The label for this field that will be displayed to end users if the style requires it.

IZl Exclude from display

Check this box to not display this field, but still load it fn the view. Use this option to not show a grouping field fn each record, or when doing advanced theming.

D Rewrite the output of this field

If checked, you can alter the output of this field by specifying a string of text with replacement tokens that can use any existing field output.

□ Output this field as a link

If checked, this field will be made into a link. The destination must be given below.

□ Trim this field to a maximum length

If checked, thisfisld be trimmed to a maximum length Fn characters.

d Link this field to its node

This will override any other link you have set,

6. We're going to have the title presented as a link. We'll elect to 'Output this field as a link', rather than 'Link this field to its node', because we don't want the link to take us to a display of the node, we want it to reload the view, passing the ID of the selected node as an argument, so that the view will load the selected job into an Attachment display. We know the URL of this view (we set it earlier as the path), but we need the nid appended to the end of the URL as an argument. The way we do this is to include the replacement pattern for the nid at the end of the URL.

With that done, we've finished the Page display. Confirm it with a preview and by hovering the cursor over the link. In the following screenshot, you can see that the node title is output as a link, and that the URL of the link is our current view with the nid appended.

the Great Pyramid fe~

http://localhtBt/guildbuildersinc,ct>m/prior-wt>rk/7

The following screenshot shows the settings for the completed Page display.

Defaults Page

Page

Add display

Analyze

Page

Display the view ss

Basic settings

Name: Page Title: Previous Projects

Styls: ttl

Unformatted Row styls. ttl Fields

Use AJAX: No Use pager: Yes Items per page: 10 Distinct: No Access; Unrestricted Caching: None Exposed form in block: No Header: None Footer: None Empty text: None Theme: Information

( Remove display

3 page, with 3 URL 3nd menu links.

+ i4 Relationships

None defined

Arguments

None defined

Fields + U

Node: Nid Node: Title

Sort criteria

Node: Post date desc

Published res Node: Type =

Content: Display =

Display completed job

Page settings

Path:

prior-work Menu: No menu

Was this article helpful?

0 0

Post a comment